• 最近写了一些关于.net中js操作的通用函数,希望和大家分享 2


    最近写了一些关于.net中js操作的通用函数,希望和大家分享:

        Public Shared Sub ConfirmAndRedirect(ByRef pgeParenet As System.Web.UI.Page, _
                                             ByVal strMessage As String, _
                                             ByVal strTruePage As String, _
                                             ByVal strFalsePage As String)
            '名称:ConfirmAndRedirect
            '功能:确认,各自转向页面
            '作者:chs
            '创建:2004/5/20
            '修改:2004/5/20
            '参数::
            '      :
            '返回:成功,True,反之,False
            '说明:
            Dim o_strErrMessage As String = "<script language=javascript>if(confirm('"

            o_strErrMessage &= strMessage & "')) this.location.replace('"

            o_strErrMessage &= strTruePage

            o_strErrMessage &= "') else this.location.replace('"

            o_strErrMessage &= strFalsePage

            o_strErrMessage &= "'); </script>"

            pgeParenet.RegisterStartupScript("Message", o_strErrMessage)

        End Sub

        Public Shared Sub ConfirmAndRunScript(ByRef pgeParenet As System.Web.UI.Page, _
                                              ByVal strMessage As String, _
                                              ByVal strTrueScript As String, _
                                              ByVal strFalseScript As String)
            '名称:ConfirmAndRunScript
            '功能:确认,各自执行脚本
            '作者:chs
            '创建:2004/5/20
            '修改:2004/5/20
            '参数::
            '      :
            '返回:成功,True,反之,False
            '说明:
            Dim o_strErrMessage As String = "<script language=javascript>if(confirm('"

            o_strErrMessage &= strMessage & "')) ("

            o_strErrMessage &= strTrueScript

            o_strErrMessage &= ") else ("

            o_strErrMessage &= strFalseScript

            o_strErrMessage &= "); </script>"

            pgeParenet.RegisterStartupScript("Message", o_strErrMessage)

        End Sub

  • 相关阅读:
    站立会议第二天
    站立会议第一天
    Scrum_Sprint
    电梯演讲之加减乘除
    The group WHATEVER is formed today
    awk简介(使用方法)
    关于Java进程流程简介
    Bootstrap_导航
    Bootstrap_按钮工具栏
    Bootstrap_下拉菜单
  • 原文地址:https://www.cnblogs.com/unruledboy/p/10450.html
Copyright © 2020-2023  润新知