Last post Oct 20, 2008 11:44 PM by DNQ
Oct 20, 2008 04:07 AM|DNQ|LINK
I have a custom httpHandler that tries to rewrite the URL using httpcontext.RewritePath( ). The only line I have (for now) in the ProcessRequest( ) of my handler is
But when the httpHandler executes nothing happens and the sample.aspx is not loaded. All I get is a blank page!
a. the request that comes in takes the form:
b. I can confirm that .someext has been correctly mapped in the IIS and ASP.NET. This is because I can use Server.Transfer( ) and redirect to the aspx I need when above request comes in.
c. sample.aspx is physically available at the application root.
d. My dev environment is:
WINXP / IIS 5.1 / ASP.NET = 2.0.50727.3053.
Any ideas why httpContext.RewritePath doesnt redirect the requst to the required resource?
Oct 20, 2008 04:17 AM|rtpHarry|LINK
Is there anything in the sample.aspx page?
RewritePath doesnt change the visible url you see in the address bar.
You use the word redirect in your description just wondering if you are looking for Response.Redirect("~/sample.aspx"); ?
Oct 20, 2008 04:52 AM|DNQ|LINK
(a) Yes I've got some text on the page to make sure that the sample.aspx was rendered.
(b) No, I'm not looking for Response.Redirect( ). I'm after httpContext.RewritePath( ). In fact am trying to learn the basics behind implementing URL rewriting, handling related issues with postbacks etc...
It cant be this difficult to get HttpContext.RewritePath( ) working, surely I'm missing something.
Oct 20, 2008 11:44 PM|DNQ|LINK
Just to confirm that this problem is NOT limited to the custom httphandler I use.
Similar behavior can be observed even if I use an .ashx file for an httphandler.
What are the basic requirements to get httpContext.RewritePath( ) working?
Is there any special authorization required set at IIS/ASP.NET level to get this working or any other settings in IIS/ASP.NET?
Or are there any known issues where this is not working under certain environments?