ScriptManager.RegisterStartupScript(Page, this.GetType(), "jscript", "alert('This browser is currently not supported on the website. Please use either latest version of Chrome or Mozilla Firefox. Click here to download<a href='~/CheckBrowser.aspx'>Download</a>');", true);
alert('This browser is currently not supported on the website. Please use either latest version of Chrome or Mozilla Firefox. Click here to download<a href='~/CheckBrowser.aspx'>Download</a>');(function() {var fn = function() {$get("ctl08_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();//]]>
**JavaScript critical error at line 135, column 158 in http://localhost:31424/Default.aspx SCRIPT1006: Expected ')'**
我收到此错误无法弄清楚错误是什么
答案 0 :(得分:1)
你需要像这样逃避引用:
ScriptManager.RegisterStartupScript(Page, this.GetType(), "jscript", "alert('This browser is currently not supported on the website. Please use either latest version of Chrome or Mozilla Firefox. Click here to download<a href=\'~/CheckBrowser.aspx\'>Download</a>');", true);
alert('This browser is currently not supported on the website. Please use either latest version of Chrome or Mozilla Firefox. Click here to download<a href=\'~/CheckBrowser.aspx\'>Download</a>');(function() {var fn = function() {$get("ctl08_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();//]]>
答案 1 :(得分:0)
试试这个:
ScriptManager.RegisterStartupScript(Page, this.GetType(), "jscript", "alert('This browser is currently not supported on the website. Please use either latest version of Chrome or Mozilla Firefox. Click here to download<a href=\'~/CheckBrowser.aspx\'>Download</a>');", true);