[英]How to show Javascript Alert message before redirecting to same page in VB.NET?
在单击按钮期间显示警告消息后,我尝试使用以下代码重定向到同一页面。
ScriptManager.RegisterStartupScript(Me, Page.GetType(), "AlertMsg", "alert('Success');", True)
Response.Redirect(Request.Url.AbsoluteUri)
但是页面重定向到同一页面而不抛出Javascript警报消息。 如何解决这个问题?
在问一个问题..之前,请先看一下关于相同主题的已问问题.....这是关于stackoverflow
不同答案链接。
ScriptManager.RegisterStartupScript(this,this.GetType(),"page redirect",
"alert('Message'); window.location='" +
Request.Url.AbsoluteUri+"';",true);
尝试这个
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "AlertMsg", "alert('Success');window.location ='"+Request.Url.AbsoluteUri+"';", True)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.