I have got a little problem with Url Rewritig process and server.transfer
use.
I would like to create a simple url rewriting process for my web site
I use in a lot of pages, the "server.transfer" property to go to one page
to another one.
In this process, I use the global.asax with Application_BeginRequest Sub.
I need to catch the whole url with querystring if exists.
First, I have used the property : HttpContext.Current.request.RawUrl.
--> I can't use " HttpContext.Current.Request.CurrentExecutionFilePa th "
because there is not the querystring.
But, my problem, by using server.transfer property is that I get always the
old page url. And my Url Rewriting process doesn't work fine.
If I use HttpContext.Current.Request.CurrentExecutionFilePa th property
in a SUB LOAD .aspx page, i get the right path. But not the queryString. If I use HttpContext.Current.Request.CurrentExecutionFilePa th in
Application_BeginRequest Sub, I get the old url page.
If I use HttpContext.Current.request.RawUrl in Application_BeginRequest
(or in SUB LOAD .aspx page), I get the querystring but the old page url.
..... I don't know how to solve my problem.
Example
First URL
http://test.intranet.com/file1/page1.aspx
Request Path gives me file1/page1.aspx
In my application the user cliks on a button and Server.Transfer occurs.
There is a transfer to the new page " /file2/page2.aspx
But with Application_BeginRequest in global.asax, "Request Path" gives me
always file1/page1.aspx and not file2/page3.aspx
I get the old URL.
There is a way to get the right URL for Url Rewriting process (using
global.asax and Application_BeginRequest ) with querystring (if querystring
exists) by using server.transfer in my website.
Thanks a lot for your help.
fabrice