我有一个名为 raise_alarm() 的方法,它显示一个基于 jquery 的消息框。但是,当我从 Updatepanel 内部的控件事件(例如提交按钮)调用此方法时,它不起作用。相关代码如下。我该如何解决?
Public Sub Raise_Alarm(ByVal p_Page As Page, ByVal p_Message As String, Optional ByVal p_IsError As Boolean = True)
Dim strScript As String
strScript = "$(function() { Mesaj('" & p_Message & "'); });" & ControlChars.NewLine
p_Page.ClientScript.RegisterStartupScript(p_Page.GetType(), "alert", strScript, True)
end sub
Private Sub dtlQuestion_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles dtlQuestion.ItemCommand
If Not User.Identity.IsAuthenticated Then
Raise_Alarm(Me, "Giriş Yapmadan Oy Veremezsiniz")
Exit Sub
End If
end sub