Groups | Blog | Home
all groups > asp.net > march 2004 >

asp.net : Problem with redirecting


ankur_jain03 NO[at]SPAM infosys.com
3/2/2004 11:18:07 PM
Hi,
I am facing a very weird problem while redirecting to another page.
The problem is as follows:
I have a website. I build the solution and run the application.
The first page is the login page. I enter a valid login and password
and click the "login" button. The click event call the database and
validates the information. After verification the Response.Redirect is
fired. The problem comes here. The redirected page does not come up.
The problem becomes weired because the same piece of code works fine
when i run the application in the Debug mode.
Please provide help. I am struck very badly at this.
Prodip Saha
3/3/2004 8:49:46 AM
Ankur,
With ASP.Net, you can use Server.Transfer("your aspx page name"). The
Server.Transfer will abort the current thread (leaving the lines of code
unexecuted below the Server.Transfer). Response.Redirect works little
differently. You must use the redirect method before the header information
gets written.

Prodip


[quoted text, click to view]

AddThis Social Bookmark Button