Reponse.Redirect in a Web Service?

I’d like to redirect a user to a specific page (a download for a zip file actually, http://www.yo.com/dl/yo.zip for example) from a web method. Could anyone tell me how to do this? I’m guessing I’d need to set the content type to something specific and write something to the response stream.

Hmm… I’m not sure this is something you can do. But I haven’t looked into. Couldn’t you use teh web service to stream the file down?

:slight_smile:

Found this on MSDN:

Redirection

If you need to provide a redirect response in your Web service, do not use the Context.Response.Redirect method because the HTTP response will differ from what the Basic Profile mandates. [R1130]

The following example shows how to give a redirect response that complies with the Basic Profile:

[WebMethod]
public string HelloWorld()
{
Context.Response.StatusCode = 307;
Context.Response.AddHeader(“Location”,“<redirect URL>”);
return null;
}

Don’t know if that helps at all!

That worked. Thanks.