Reputation: 2428
How can I redirect www.xxx.com/hakkimda.aspx page to www.xxx.com/default.aspx?=hakkimda in Asp.Net?
Upvotes: 0
Views: 2537
Reputation: 1
you should type:
using system.web.security;
then type in page load:
if (!Request.IsAuthenticated)
{
Response.Redirect("~/default.aspx");
}
Upvotes: -1
Reputation: 32137
Url changes, [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>
Upvotes: 3
Reputation: 9027
Really, the easiest way is javascript.
<script type="text/javascript"> window.location.href = "www.xxx.com/default.aspx?=hakkimda"; </script>
Upvotes: 0
Reputation: 11844
Response.Redirect("default.aspx", True)
or simplye Response.Redirect("TeleCmslogin.aspx")
Hope the above line of code will helps you.
Upvotes: 0
Reputation: 45942
<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>
Upvotes: 2