Re: The right URL, server.transfer

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Justin,

Thanks for your help and your explanation.
I think i have to re-think a part of my application if i want to apply
rewriting solution... .!

Have a nice week end.

fabrice.


"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> a écrit
dans le message de news: O%23934PaKGHA.604@xxxxxxxxxxxxxxxxxxxxxxx
Fabrice,

That's because of the order of execution the Begin Request is firing when
the client posts to the server with the old url. Unless the client is
contacted again and told to request the new page (e.g. Response.Redirect)
the first request into the Global.asax will always use the old url.
Server.Transfer then executes the new page instead of the old one, but the
Global.asax file is not hit again because the client has not made a new
request. I'm afraid you'll need to re-think your solution. If you need to
use Server.Transfer instead of Response.Redirect then you'll need to
access HttpContext.Current.Request.CurrentExecutionFilePath at the page
level.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Fabrice" <emouchet@xxxxxxxxxxxxxxx> wrote in message
news:eIuZ%23AZKGHA.1236@xxxxxxxxxxxxxxxxxxxxxxx
Hello

Does a solution exist to get always the right path when you use
Server.Transfer in web application (version 1.1) ?

I want to rewrite my URL by use Global.asax and Application_BeginRequest
Sub. But as i use server.transfer in my web application i get always the
old URL even if
i use the property
"HttpContext.Current.Request.CurrentExecutionFilePath".

My global.asax

...
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As
EventArgs)

Dim myCurrentURL As String =
HttpContext.Current.Request.CurrentExecutionFilePath
...

End Sub

But it seems not to work with server.tranfser property. I always get the
old URL.
For example, If I transfer a user to the page2.aspx from the page1.aspx
by use of server.transfer property, I will get "page1.aspx" as result
with the property HttpContext.Current.Request.CurrentExecutionFilePath
.... although i m really on the page2.aspx

If i place the same code in the SUB LOAD of each page i get the right
URL.

So if someone can help me....

thanks a lot.





.



Relevant Pages

  • Re: Chat client/server print failed
    ... is the print statement in the send_msg_all sub. ... leave the server running for testing purposes. ... # This would be the end of file, so close the client ... # just read means there is a complete request waiting ...
    (comp.lang.perl.misc)
  • Chat client/server print failed
    ... This is a chat client wrote in perl Gtk2. ... is the print statement in the send_msg_all sub. ... leave the server running for testing purposes. ... # just read means there is a complete request waiting ...
    (comp.lang.perl.misc)
  • Re: Asynchronous HttpWebRequest
    ... > your approach will not work with a web app. ... later on the request ... > | async request works fine and I get a proper response. ... > | End Sub ...
    (microsoft.public.dotnet.framework.aspnet)
  • iptables logfile parsing tool
    ... I'm using this perl tool to scan my logfiles each night. ... sub generate_summary ... -key key search key for firewall logs. ...
    (comp.os.linux.networking)
  • Re: User.IsInRole not redirecting
    ... Dim hash As String = FormsAuthentication.Encrypt ... Dim cookie As New HttpCookie ... Sub Application_AuthenticateRequest(ByVal sender As Object, ... Each request that comes in (via the ...
    (microsoft.public.dotnet.framework.aspnet.security)