zoukankan      html  css  js  c++  java
  • 最近写了一些关于.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

  • 相关阅读:
    springboot入门系列(一):简单搭建springboot项目
    springboot入门系列(二):SpringBoot整合Swagger
    springboot入门系列(三):SpringBoot教程之RabbitMQ示例
    springboot入门系列(四):SpringBoot和Mybatis配置多数据源连接多个数据库
    Linux下安装RabbitMQ
    Mybatis原理之数据源和连接池
    springboot入门系列(五):SpringBoot连接多RabbitMQ源
    jsp中<c:foreach>分页标签的序号问题
    Java中删除一个文件夹下的所有文件(包括子目录内的文件)
    接口的幂等性
  • 原文地址:https://www.cnblogs.com/unruledboy/p/10450.html
Copyright © 2011-2022 走看看