Page Redirect
-
I want my web form to redirect to a different url when a user hits submit on a data entry form. I was wondering if anyone could give me an idea on how to do this. I would like to do it with C# if possible, so in other words I want to avoid javascript since I am doing it with code behind. Thanks if you can help. Matt Newman
-
I want my web form to redirect to a different url when a user hits submit on a data entry form. I was wondering if anyone could give me an idea on how to do this. I would like to do it with C# if possible, so in other words I want to avoid javascript since I am doing it with code behind. Thanks if you can help. Matt Newman
Hi, Use the Redirect method of HttpResponse object In C# Response.Redirect("http://www.codeproject.com"); Pankaj
-
I want my web form to redirect to a different url when a user hits submit on a data entry form. I was wondering if anyone could give me an idea on how to do this. I would like to do it with C# if possible, so in other words I want to avoid javascript since I am doing it with code behind. Thanks if you can help. Matt Newman
If I understand your question correctly.......... 1) Use a Web controls command button and add Click event to it. Inside the event handler write, Response.Redirect("SecondPage.aspx"); where the SecondPage.aspx will be the page to which you want to redirect. 2) If you are using the submit button, remove the action tag from the form element. In the page load event handler write, If(IsPostback) Response.Redirect("SecondPage.aspx"); If you dont want to do anything else than redirecting the page, I hope you can use image button instead of command buttons for efficiency. But I hope you should be doing some "saving data" Process and trying to redirect to other page.
-
Hi, Use the Redirect method of HttpResponse object In C# Response.Redirect("http://www.codeproject.com"); Pankaj
-
If I understand your question correctly.......... 1) Use a Web controls command button and add Click event to it. Inside the event handler write, Response.Redirect("SecondPage.aspx"); where the SecondPage.aspx will be the page to which you want to redirect. 2) If you are using the submit button, remove the action tag from the form element. In the page load event handler write, If(IsPostback) Response.Redirect("SecondPage.aspx"); If you dont want to do anything else than redirecting the page, I hope you can use image button instead of command buttons for efficiency. But I hope you should be doing some "saving data" Process and trying to redirect to other page.