response.redirect is not working but server.transfer is working

G

gaurav tyagi

in my appplication if i try to go to next page using
response.redirect, it does not work and control remains on same page
but if i use server.transfer control goes to nex page??

can any one explain me why ?????
 
G

gaurav tyagi

old way (Not
working)------------------------------------------------------------------------------------------------------

private void btnManagement_Click(object sender, System.EventArgs e)
{
try
{

Response.Redirect( "ManagementMenu.aspx", false );
}
catch( Exception aExc)
{
string sErrMsg = "Failed to go to requested web page !\n\n" +
"Details:\n\n" +
aExc.Message;
GuiManipulator.DisplayErrorPage( this.Page, sErrMsg );
}


}

Next
way(notWorking)----------------------------------------------------------------------------------------------------



private void btnManagement_Click(object sender, System.EventArgs e)
{
Response.Redirect( "ManagementMenu.aspx", false );

}


new
Way(Working)---------------------------------------------------------------------------------------------------

private void btnManagement_Click(object sender, System.EventArgs e)
{
Server.Transfer("ManagementMenu.aspx");

}
 
G

gaurav tyagi

Edwin said:
i think you chould clear out the 2nd param :)











i have checked this one also
if i remove second argument , by default it takes true this means
response.redirect will stop the existing thread and go for new thread
but here it is not enable to open next page so a blank page comes.
so if i put false , framework do not close current thread and try to
open next page thread but here also it is not able to open next page
so current page remains there
 
G

gaurav tyagi

NOT WORKING------------------------------


private void btnManagement_Click(object sender,
System.EventArgs e)
{
Response.Redirect( "ManagementMenu.aspx);


}
 
J

Jim Cheshire

NOT WORKING------------------------------


private void btnManagement_Click(object sender,
System.EventArgs e)
{
Response.Redirect( "ManagementMenu.aspx);


}

When you do a response.redirect like this, the server should send a
302 HTTP response with a location header that tells the browser where
to go. The browser will then do an HTTP GET for that location. A
Netmon trace (or a trace using Ethereal) will give you an indication
as to what is breaking down.

Jim Cheshire
 
G

gaurav tyagi

it is in same application Management.aspx resides.
both pages are in same application
 
T

thomson

in the button click only response.redirect should be there no try catch
and let me know the result


thomson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top