目标:实现页面加载的时候弹出提示框,点击确定后跳转到指定页面。我的方法:
一个空白的页面。
C#后台如下代码: protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<script type=\"text/javascript\">alert(\"fdfdf\");location(\"default.aspx\")</script>");
}
存在问题:
alert事件可以实现,但是无法实现location事件。请高手赐教!
Response.Write("<script type=\"text/javascript\">alert(\"fdfdf\");location.href=(\"default.aspx\")</script>");
也可以在js中写fucntion gotopage()
{
window.location.href=''
}
然后在CS代码中注册脚本事件page.registerStart...