Javascript window.setTimeout(&x27;window.location=";http://www.example.com"&x27;,2000年);暗藏
我想在代码隐藏中创建此脚本,因为它需要动态更改urlJavascript window.setTimeout(&x27;window.location=";http://www.example.com"&x27;,2000年);暗藏,javascript,c#,asp.net,Javascript,C#,Asp.net,我想在代码隐藏中创建此脚本,因为它需要动态更改url <script language="javascript" type="text/javascript"> window.setTimeout('window.location="http://www.example.com"; ', 2000); </script> 有人能告诉我怎么做吗试试这个 100%工作和测试 您需要使用@进行转义序列和一些更改,如下所示 ScriptManager.RegisterSta
<script language="javascript" type="text/javascript">
window.setTimeout('window.location="http://www.example.com"; ', 2000);
</script>
有人能告诉我怎么做吗试试这个
100%工作和测试
您需要使用@
进行转义序列和一些更改,如下所示
ScriptManager.RegisterStartupScript(this, this.GetType(),Guid.NewGuid().ToString(), @"window.setTimeout('window.location=\'http://www.example.com\',5000');", true);
ScriptManager.RegisterStartupScript(this, this.GetType(),Guid.NewGuid().ToString(), @"window.setTimeout('window.location=\'http://www.example.com\',5000');", true);