Potsback url

Topics: Developer Forum, Project Management Forum, User Forum
Apr 24, 2008 at 4:32 AM
Is it possible to maintain the url during postback using u.can anybody explain me in detail how to do that.
i have tried with appbrowser and htmlform. these methods work fine.but i wana have the best one.

Any help will be appreciated in Advance

Apr 28, 2008 at 5:35 PM
What are you building your web app in? If you're using ASP.NET -- I know of this solution here: http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

Scroll down to the "Handling ASP.NET PostBacks with URL Rewriting". The App_Browser is the best and easiest way. Download Scott's sample app and you can see the class he created that rewrites the action= attribute for the Form tag.

If your using Classic ASP, I guess you could write the form action attribute using the U flag. You'll access the HTTP_X_REWRITE_URL. Other than manually coding this for Classic ASP, I'm not sure how else to go about it.

Any other web technology, I have no ideas.
May 13, 2008 at 5:17 AM

Hi Maze thanx for your reply.
I am using Asp.Net 1.1 version.
so i cannot use App_browser mentioned by scottgu.
u have mentioned about  HTTP_X_REWRITE_URL.can u explain me in detail how will i use it? should i mention it in global.asax?
where should i set  u.
May 13, 2008 at 5:06 PM
The U flag gets set on each filter rule in your .ini file. This will tell the IIRF ISAPI to store the {HTTP_X_REWRITE_URL} in a Request.ServerVariable so you can use it as needed for maintaining the rewritten url.
Sep 16, 2009 at 5:43 PM

My C# version, has a small change to allow this to work. Sheck the solution here. I'm using versio IIRF version 2.0 preview.


// value = context.Request.RawUrl;
value = context.Request.ServerVariables["HTTP_X_REWRITE_URL"];