如何在Asp.Net中重定向网页?

时间:2021-03-01 08:09:30

How can I redirect www.xxx.com/hakkimda.aspx page to www.xxx.com/default.aspx?=hakkimda in Asp.Net?

如何将www.xxx.com/hakkimda.aspx页面重定向到Asp.Net中的www.xxx.com/default.aspx?=hakkimda?

6 个解决方案

#1


3  

Url changes, [onserver]

网址更改,[onserver]

Response.Redirect("Default2.aspx?foo=baar",true);

Url remain Same [on server]

网址保持相同[在服务器上]

Server.Transfer("Default2.aspx?poop=baar");

Url changes [on client]

网址更改[在客户端]

<script type="text/javascript">
     window.location="http://som_eother_location.html"
</script>

#2


2  

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","www.xxx.com/default.aspx?=hakkimda");
}
</script> 

#3


2  

Response.Redirect() - msdn link

Response.Redirect() - msdn链接

#4


0  

Response.Redirect("default.aspx", True)

or simplye Response.Redirect("TeleCmslogin.aspx") Hope the above line of code will helps you.

或者简单的Response.Redirect(“TeleCmslogin.aspx”)希望上面的代码行能够帮到你。

#5


0  

Really, the easiest way is javascript.

真的,最简单的方法是javascript。

<script type="text/javascript"> window.location.href = "www.xxx.com/default.aspx?=hakkimda"; </script>

#6


-1  

you should type:

你应该键入:

   using system.web.security;

then type in page load:

然后输入页面加载:

  if (!Request.IsAuthenticated)
    {
        Response.Redirect("~/default.aspx");
    }

#1


3  

Url changes, [onserver]

网址更改,[onserver]

Response.Redirect("Default2.aspx?foo=baar",true);

Url remain Same [on server]

网址保持相同[在服务器上]

Server.Transfer("Default2.aspx?poop=baar");

Url changes [on client]

网址更改[在客户端]

<script type="text/javascript">
     window.location="http://som_eother_location.html"
</script>

#2


2  

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","www.xxx.com/default.aspx?=hakkimda");
}
</script> 

#3


2  

Response.Redirect() - msdn link

Response.Redirect() - msdn链接

#4


0  

Response.Redirect("default.aspx", True)

or simplye Response.Redirect("TeleCmslogin.aspx") Hope the above line of code will helps you.

或者简单的Response.Redirect(“TeleCmslogin.aspx”)希望上面的代码行能够帮到你。

#5


0  

Really, the easiest way is javascript.

真的,最简单的方法是javascript。

<script type="text/javascript"> window.location.href = "www.xxx.com/default.aspx?=hakkimda"; </script>

#6


-1  

you should type:

你应该键入:

   using system.web.security;

then type in page load:

然后输入页面加载:

  if (!Request.IsAuthenticated)
    {
        Response.Redirect("~/default.aspx");
    }