RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
C#封装的JS(JavaScript)操作类的代码

代码期间,将做工程过程比较常用的一些代码片段做个备份,如下的代码内容是关于C#封装的JS(JavaScript)操作类的代码,应该能对各位朋友有帮助。

创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于网站设计、成都网站设计、殷都网络推广、微信小程序开发、殷都网络营销、殷都企业策划、殷都品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联建站为所有大学生创业者提供殷都建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com

using System.Web;

namespace DotNet.Utilities
{
    public class JsHelper
    {
        public static void AlertAndRedirect(string message, string toURL)
        {
            string js = "";
            HttpContext.Current.Response.Write(string.Format(js, message, toURL));
            HttpContext.Current.Response.End();
        }

        public static void AlertAndGoHistory(string message, int value)
        {
            string js = @"";
            HttpContext.Current.Response.Write(string.Format(js, message, value));
            HttpContext.Current.Response.End();
        }

        public static void Redirect(string toUrl)
        {
            string js = @"";
            HttpContext.Current.Response.Write(string.Format(js, toUrl));
        }

        public static void AlertAndParentUrl(string message, string toURL)
        {
            string js = "";
            HttpContext.Current.Response.Write(string.Format(js, message, toURL));
        }

        public static void ParentRedirect(string ToUrl)
        {
            string js = "";
            HttpContext.Current.Response.Write(string.Format(js, ToUrl));
        }

        public static void BackHistory(int value)
        {
            string js = @"";
            HttpContext.Current.Response.Write(string.Format(js, value));
            HttpContext.Current.Response.End();
        }

        public static void Alert(string message)
        {
            string js = "";
            HttpContext.Current.Response.Write(string.Format(js, message));
        }

        public static void RegisterScriptBlock(System.Web.UI.Page page, string _ScriptString)
        {
            page.ClientScript.RegisterStartupScript(page.GetType(), "scriptblock", "");
        }
    }
}

名称栏目:C#封装的JS(JavaScript)操作类的代码
网页地址:http://sczitong.cn/article/psjsso.html