繁体   English   中英

在重定向到VB.NET的同一页面之前如何显示Javascript Alert消息?

[英]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不同答案链接。

如何在重定向页面之前获取警报消息

在ASP.NET中重定向之前的Javascript警报

Asp.net Webform显示警报和重定向

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM