Public Shared Sub RunScript(ByRef pgeParenet As System.Web.UI.Page, _
ByVal strScript As String)
'名称:RunScript
'功能:封装执行脚本
'作者:unruledboy
'创建:2003/8/20
'修改:2004/2/5
'参数::
' :
'返回:成功,True,反之,False
'说明:
Dim o_strScript As String = "<script language=javascript>"
o_strScript = o_strScript & strScript & " </script>"
pgeParenet.RegisterStartupScript("Script", o_strScript)
End Sub
Public Shared Sub ShowMessage(ByRef pgeParenet As System.Web.UI.Page, _
ByVal strMessage As String, _
Optional ByVal scrScript As String = "")
'名称:ShowMessage
'功能:封装显示提示
'作者:unruledboy
'创建:2003/8/20
'修改:2004/2/5
'参数::
' :
'返回:成功,True,反之,False
'说明:
Dim o_strErrMessage As String = "<script language=javascript>alert(' "
o_strErrMessage &= strMessage & "');"
If scrScript <> "" Then
o_strErrMessage &= scrScript
End If
o_strErrMessage &= " </script>"
pgeParenet.RegisterStartupScript("Message", o_strErrMessage)
End Sub
Public Shared Sub ShowMessageAndRedirect(ByRef pgeParenet As System.Web.UI.Page, _
ByVal strMessage As String, _
ByVal strScript As String)
'名称:ShowMessageAndRedirect
'功能:封装显示提示
'作者:unruledboy
'创建:2003/8/20
'修改:2004/2/5
'参数::
' :
'返回:成功,True,反之,False
'说明:
Dim o_strErrMessage As String = "<script language=javascript>alert(' "
o_strErrMessage &= strMessage & "');this.location.replace('"
o_strErrMessage &= strScript
o_strErrMessage &= "'); </script>"
pgeParenet.RegisterStartupScript("Message", o_strErrMessage)
End Sub