aspx页面重定向到新的一页 [英] aspx page to redirect to a new page

查看:124
本文介绍了aspx页面重定向到新的一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是浏览器重定向到一个新的页面与ASPX页面所需的code?

我已经试过这在我的页面Default.aspx的:

 <%的Response.Redirect(new.aspx,真正的); %GT;

 <%@的Response.Redirect(new.aspx,真正的); %GT;

和这些导致了这是不确定的服务器错误。我看不到错误code;因为服务器不在我的控制,并且错误是不公开的。

请提供所有必要的code从页面到最后的1号线,和我真的AP preciate它。


解决方案

 <%@页面语言=C#%>
<脚本=服务器>
  保护覆盖无效的OnLoad(EventArgs的发送)
  {
      的Response.Redirect(new.aspx);
      base.OnLoad(E);
  }
< / SCRIPT>

What is the code required to redirect the browser to a new page with an ASPX page?

I have tried this on my page default.aspx :

<% Response.Redirect("new.aspx", true); %>

or

<%@ 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.

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");
      base.OnLoad(e);
  }
</script>

这篇关于aspx页面重定向到新的一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆