更新时间:2023-12-05 22:49:28
我不知道你为什么使用response.redirect()?
尝试使用,
I don''t know why are you using response.redirect()?
Try to use,
Page.ClientScript.RegisterStartupScript(Page.GetType(), "my", "alert("Error message");", true)
Response.Redirect("Configuration.aspx",false);
如果您还有其他问题,请告诉我。
If you have any further problem, So please let me know.
您好,
在将任何标头/数据发送到客户端之前,应使用Response.Redirect。将忽略任何响应正文内容,例如原始URL指示的页面中显示的HTML文本或Response.Write文本。此外,当处理Redirect方法时,终止当前页面中的代码执行,因此页面中的后续代码也将被忽略。如果你真的想显示错误信息,那么你可以这样做
Hello,
Response.Redirect should be used before sending any headers/data to the client. Any response body content such as displayed HTML text or Response.Write text in the page indicated by the original URL is ignored. In addition, code execution in the current page is terminated when the Redirect method is processed, so subsequent code in the page will also be ignored. If you really really want to display the error message then you can do it
location.replace(newURL)
将用户发送到Configuration.aspx。
to send user to Configuration.aspx.
问候,
Regards,