Last post Jun 06, 2007 11:33 PM by Rex Lin - MSFT
Jun 05, 2007 10:19 PM|ishvinder|LINK
I have a web service whhich contains a aweb method, the webmethod
After generating an email in the web method I want to
refresh(Redirect) to another page.
I am currently doing this using this.context.Response.Redirect("http://
google.com"); this works when I invoke the web service directly from
an HTML page using the post method
<form runat="server" method="post" action="http://localhost:1205/
This works fine and after the email is generated the page refreshes
to the right target.
The problem comes in when I invoke that same web method from an aspx
page via code behind.
In order to get this to work I add a web refernce to my aspx project
and then I call the web method progammatically. In this case, my
refresh does not work even though the webservice is invoked.
Is there a reason why Response .Redirect doesnot work when I invoke my
web service programmatically.
However, it works when I invoke it directly via a HTML page.
Jun 06, 2007 01:31 AM|venkatzeus|LINK
Could you try using the server.transfer (http://google.com);
It is all done at the server so will work even if you have already sent some output to the client
or else you could try the Response.Redirect("http://google.com",false);
Jun 06, 2007 09:24 AM|ishvinder|LINK
I have tried both Server.transfer(http://google.com);
and also Response.redirect(http://google.com,false);
But nothing is working....
Also, the exact error which I am getting is...
Jun 06, 2007 09:38 AM|venkatzeus|LINK
Could you please check : http://support.microsoft.com/kb/888418
Could you try to refer the web service again and then running the application?
Could you please also try doing:
response.clear(); and then using response.redirect()
Jun 06, 2007 11:33 PM|Rex Lin - MSFT|LINK
You can try this syntax:
public string HelloWorld()
Context.Response.StatusCode = 307;
I hope the above information will be helpful. If you have any issues or concerns, please let me know. It's my pleasure to be of assistance