Tuesday, August 13, 2013

ASP.NET Redirect or Navigate user one page to another page

You might want to redirect users from one ASP.NET Web page to another Web page. For example, you might do this as part of a multi-page form.

There are a number of ways to redirect pages, such as the following:

Method1:

Setting PostBackUrl property of ASP.NET button control, like this


Button1.PostBackUrl = "Webform2.aspx";

or

<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/Webform2.aspx" />

Method2:

Response.Redirect("Webform2.aspx");


Reference: 




No comments:

Post a Comment

http://myaspdotnetworld.blogspot.com