Rank: Newbie Groups: Member
Joined: 10/8/2015 Posts: 6
|
Hello,
I have implemented a resource handler and I would like to redirect the browser control to different URL.
Can you please provide some sample code on what the response object would need to have in order to make the control redirect?
I have tried
public override void ProcessRequest(Request request, Response response) { //Only process EmbeddedPageUrl if (request.Url.Contains(UrlPrefix)) { var url = new Uri(request.Url); response.RedirectLocation = url.Host + "/process-page"; response.StatusCode = 302; response.End(); } }
Thanks G
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Your code is correct. You can try the following code with our TabbedBrowser example and you should see it works fine:
Code: C#
if (string.Compare(request.Url, EmbeddedPageUrl, true) == 0)
{
response.RedirectLocation = "http://www.google.com";
response.StatusCode = 302;
response.End();
}
Thanks!
|