当我(成功)完成新用户注册时,我想从我的代码隐藏中更改新通知页面中的当前页面。
为此,我使用了 javascript:
<script type="text/javascript">
var Tag;
function notifyscript(TagName) {
tag = TagName;
var myTag = document.getElementById(tag);
myTag.click();
}
为了调用:
<a id="notify" href="http://localhost/Pages/Account/Notification.aspx" target="_parent"/>
但是当我在本地运行它时,它给我带来了一个错误。
500(HTTP 错误 500.0 - 内部服务器错误
调用失败 LoadLibraryEx στο φίλτρο ISAPI "C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll"
当我在网络上运行它时,什么也不做。
有人知道如何执行此操作吗?
我的意思是当后面的代码结束注册时打开一个新页面。
最佳答案
请在代码隐藏中尝试此代码:
string url="www.google.com";
string msg = "<script type='text/javascript'>" +
" $(document).ready(function(){ " +
" window.location.href='" + url + "';" +
" });" +
"</script>";
page.ClientScript.RegisterStartupScript(page.GetType(), "myURL", msg);
关于javascript - 我想在注册完成后在我的网站上运行一个新页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20840932/