aspx页面重定向到新页面 [英] aspx page to redirect to a new page
本文介绍了aspx页面重定向到新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将浏览器重定向到带有 ASPX 页面的新页面需要什么代码?
What is the code required to redirect the browser to a new page with an ASPX page?
我在我的页面 default.aspx 上试过这个:
I have tried this on my page default.aspx :
<% Response.Redirect("new.aspx", true); %>
或
<%@ Response.Redirect("new.aspx", true); %>
这些导致了一个未确定的服务器错误.我看不到错误代码;因为服务器不在我的控制之下,而且错误不是公开的.
And these resulted in a server error that is undetermined. I cannot see the error code; because the server is not in my control and the errors are not public.
请提供从页面第 1 行到最后的所有必要代码,我将不胜感激.
Please provide all necessary code from line 1 of the page to the end, and I would really appreciate it.
推荐答案
<%@ Page Language="C#" %>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
Response.Redirect("new.aspx");
}
</script>
这篇关于aspx页面重定向到新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文