Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Protected Sub Delete_onGridRow_Click(ByVal sender As Object, ByVal e As EventArgs)
           ostate = New BLstate

           str = DirectCast(sender, System.Web.UI.WebControls.ImageButton).CommandName.ToString
           With ostate
               .stateid = str
           End With

           result = state.state_delete(ostate)

           If result > 0 Then
               gvList.DataSource = state.Listview(txtstate.Text, ddstateStatus.SelectedValue)
               'Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "alert", "alert('item not deleted');", True)
               'Page.ClientScript.RegisterStartupScript(Me.GetType, "alert", "showDialog('Warning','Item not deleted.','warning');", True)
               'Response.Write("item not deleted")
               ScriptManager.RegisterStartupScript(Me, Me.GetType, "alert",script, True)

           End If

       Catch ex As Exception
       End Try
   End Sub

I am using contentpalaceholder for binding another pages , server side validate is not responde( client script block ),i am tried so many codes ,my codes are here,please give me some solutions.
Updated 15-Dec-11 5:07am
RaviRanjanKr 15-Dec-11 11:08am    
[Edited] Pre tag is removed from texts or Normal sentences[/Edited]

1 solution

Something about the name of your Sub is bothering me, so I'll ask a question about it. Is this supposed to be a generic button click handler, or is this a GridRow click handler? Either way, ensure that it is tied into your aspx page properly by making sure it is tied to the proper onclick property there.
Share this answer
Vasim889 16-Dec-11 0:03am    
Delete_onGridRow_Click is a (grideview imagebutton commandname)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900