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);


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 ')'**

このエラーが発生しています エラーの内容がわかりません

4

2 に答える 2

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);})();//]]>
于 2013-05-21T08:26:15.347 に答える
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);
于 2013-05-21T08:26:08.120 に答える