Redirect a page in c#

Posted by Vivekjj under ASP.NET on 11/5/2012 | Points: 10 | Views : 1211 | Status : [Member] | Replies : 5
How to redirect a page ? in javascript and c#




Responses

Posted by: Sandhyab on: 11/5/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Vivekji,

In javascript to redirect a page use windows.location. And, In C# we can use Response.Redirect.

Example:
Response.Redirect("http://www.microsoft.com");//(In C#)
window.location="login.html";//(In Javascript)

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Krv on: 11/5/2012 [Member] Starter | Points: 25

Up
0
Down
a. you can use Server.Transfer or Response.Redirect or ccontrol's Postback URL to redirect to another page in C#
b. You can Use windows.Location in javascript


Thanks,
R.Vasanth
MCTS(SQL Server & BI)
http://bigdatatech.blogspot.com

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kalaikathiravan on: 11/6/2012 [Member] Starter | Points: 25

Up
0
Down
in Asp.net with C# Using 2 types of redirection
a)Response.Redirect("http://www.microsoft.com");
Its will support redirect the page in one server to another server
b)server.transfer("home.aspx");
It will support only redirect the web page with in the server only not support one server two another server.
c)java script
window.location="login.html";

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sourabh07 on: 11/6/2012 [Member] Starter | Points: 25

Up
0
Down
hi...

in addition to above....

In Response.Redirect the address bar is changed and occupy the new page address. While in Server.Transfer , it is not there, It persists the previous page address only.

Sourabh07

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 11/30/2012 [Member] Starter | Points: 25

Up
0
Down
Response.Redirect(" Page name where you want to send ");

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response