Problem with redirecting

  • Thread starter Thread starter Ankur Jain
  • Start date Start date
A

Ankur Jain

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.
TIA
 
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
 
Back
Top