GeekZilla
Fixing Form Action on UrlRewrite
IF you're rewriting URL's, you've probably come across the same problem I had.
When posting back on the page, the real URL is used.. this is a real pain if you're writing a page which uses the RawUrl to serve up relevant content.
I had a good look around the web for a solution. These ranged from creating a custom HtmlForm control to replacing the form tag in the App_Browsers folder.
The following is simple and worked for me.
Place the following code in the Page_Load of the page you're serving up.
HttpContext.Current.RewritePath(HttpContext.Current.Request.RawUrl);
Hope this helps.
Paul is the COO of kwiboo ltd and has more than 20 years IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services.
Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.
Comments
Paul
said:
Paul, you're a life saver, I've been tearing my hair out going through overly complicated solutions to this problem for the last coupel of hours, Thanks for that golden nugget
Peter
said:
Paul, i love you! this works perfect for me
Casey Mack
said:
Perfect, worked like a charm! Thanks so much!
Tom Wilson
said:
Thank the lords. I love you.
phayman
said:
You're all welcome