您的位置:首页 > Web前端 > JavaScript

asp.net 后台 修改 javascript 变量

2015-09-28 13:06 465 查看
Util.JSSetChange(Page, GetType());

public static void JSSetChange(Page page, Type cstype)
{
// Define the name of the client scripts on the page.
String csname1 = "ClickScript";

// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = page.ClientScript;

// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
String cstext1 = "hasChanged = true;"; //前台界面有个页面级别的变量叫hasChanged
cs.RegisterStartupScript(cstype, csname1, cstext1, true);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: