469,917 Members | 1,834 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

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

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 ?????

Jan 18 '06 #1
14 3808
Hi,
Can you post how you are using Response.Redirect ?
Patrick

"gaurav tyagi" <gt*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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 ?????

Jan 18 '06 #2
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");

}

Jan 18 '06 #3
i think you chould clear out the 2nd param :)
"gaurav tyagi" <gt*****@gmail.com> schreef in bericht
news:11**********************@g44g2000cwa.googlegr oups.com...
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");

}

Jan 18 '06 #4

Edwin Knoppert wrote:
i think you chould clear out the 2nd param :)
"gaurav tyagi" <gt*****@gmail.com> schreef in bericht
news:11**********************@g44g2000cwa.googlegr oups.com...
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");

}




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


Jan 18 '06 #5
NOT WORKING------------------------------
private void btnManagement_Click(object sender,
System.EventArgs e)
{
Response.Redirect( "ManagementMenu.aspx);
}

Jan 18 '06 #6
On 18 Jan 2006 04:06:53 -0800, "gaurav tyagi" <gt*****@gmail.com>
wrote:
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
--
Blog:
http://blogs.msdn.com/jamesche
Jan 18 '06 #7
Tell me where is your Management.aspx page reside?

Jan 18 '06 #8
it is in same application Management.aspx resides.
both pages are in same application

Jan 19 '06 #9
Tell me the folder structure

Jan 19 '06 #10
in same folder both page resides

Jan 19 '06 #11

Remove the try catch block and let me know the result
thomson

Jan 19 '06 #12
there is no folder
this is a simple application which has no module , no folder

Jan 19 '06 #13

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

Jan 19 '06 #14
there is no try catch

Jan 20 '06 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Justin | last post: by
5 posts views Thread by Paul de Goede | last post: by
4 posts views Thread by Harsh Thakur | last post: by
1 post views Thread by Sospeter | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.