标签:ati text onclick clu span nbsp btn nts function
StringBuilder sb = new StringBuilder(); sb.Append("<input type=\"text\" id=\"txtGo\" name=\"txtGo\" style=\" width:30px\" >"); sb.Append("<input type=\"button\" id=\"btnGo\" name=\"btnGo\" value=\"跳转\" onclick=\"pagego();\" >");
string scriptstrs = ""; scriptstrs += "function pagego(){"; scriptstrs += " var val = document.getElementById(‘txtGo‘).value;"; scriptstrs +=" if (val >"+PageCount+") {alert(‘不能大于‘+"+PageCount+");}"; scriptstrs += "else {window.location.href = ‘WordManager.aspx?page=‘+val;}}"; if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "keys")) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "keys", scriptstrs, true); }
string scriptstrs = "<script>alert(‘欢迎光临!‘);</script>"; if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(),"welcome")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "welcome", scriptstrs); }
首先创建 js文件test.js
if (!Page.ClientScript.IsClientScriptIncludeRegistered(this.GetType(), "keys"))//判断keys是否已注册过 { Page.ClientScript.RegisterClientScriptInclude("keys", "testjs.js"); }
标签:ati text onclick clu span nbsp btn nts function
原文地址:http://www.cnblogs.com/sunxi/p/6382194.html