url rewrite

  • Thread starter Thread starter dodgeyb
  • Start date Start date
D

dodgeyb

newbie to asp.net url rewriting and need help understanding.

if I simply add to global.asax file :

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

If InStr(Request.CurrentExecutionFilePath,
"userfriendlyurl.aspx") Then
Context.RewritePath("realurl.aspx", False)
End If
End Sub


This appears to work fine.

what relevance / need is there to involve httpHandlers or
httpModules ?

cheers
Chris
 
Hello dodgeyb,

using httpHandler allows you to extract you rewrting to the separate dlll
and distribute it amon different projects, not only current one

---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


d> newbie to asp.net url rewriting and need help understanding.
d>
d> if I simply add to global.asax file :
d>
d> Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal
d> e As System.EventArgs)
d>
d> If InStr(Request.CurrentExecutionFilePath,
d> "userfriendlyurl.aspx") Then
d> Context.RewritePath("realurl.aspx", False)
d> End If
d> End Sub
d> This appears to work fine.
d>
d> what relevance / need is there to involve httpHandlers or httpModules
d> ?
d>
d> cheers
d> Chris
 
Back
Top