客户端脚本块在我的页面中不起作用. [英] client side scriptblock are not working in my pages.
本文介绍了客户端脚本块在我的页面中不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Protected Sub Delete_onGridRow_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
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)
gvList.DataBind()
'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
MsgBox(ex.Message)
End Try
End Sub
我正在使用contentpalaceholder来绑定其他页面,服务器端验证未响应(客户端脚本块),我尝试了太多代码,我的代码在这里,请给我一些解决方案.
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.
推荐答案
关于您的Sub名称的事情困扰着我,所以我会问一个问题.这应该是通用按钮单击处理程序,还是GridRow单击处理程序?无论哪种方式,请确保将其绑定到适当的onclick属性,以确保将其正确绑定到aspx页面.
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.
这篇关于客户端脚本块在我的页面中不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文