473,480 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HttpContext.RewritePath Broken in 2.0 Final Relase

I was playing around with Beta 2 of VS2005, .NET 2.0, and built an
IHttpModule do allow me to have nice URL's in my web app. It was working
great. I had a URL like:

http://mydomain.com/Users/BobSmith/
or
http://mydomain.com/Users/BobSmith

The "BobSmith" didn't actually exist. My HttpModule would use RewritePath
method to return a page from:

http://mydomain.com/Users/Default.aspx?userid=BobSmith

Default.aspx was built from a MasterPage, and the MasterPage referenced
style sheets and some images. These links were written using the "~"
character (i.e. "~/pics/something.gif"). I found that if I had to use:

httpContext.RewritePath(
"http://mydomain.com/Users/Default.aspx?userid=BobSmith", false);

when calling RewritePath, otherwise the links to my gif's and stylesheets
rendered by http://mydomain.com/Users/Default.aspx?userid=BobSmith would be
wrong and thus they wouldn't show up.

Now I have installed (on a fresh Virtual PC) the final release 180-day trial
of the Team System Suite. I broght my code over, and RewritePath no longer
works. Using
httpContext.RewritePath(
"http://mydomain.com/Users/Default.aspx?userid=BobSmith", false);
seems to now work the same as
httpContext.RewritePath(
"http://mydomain.com/Users/Default.aspx?userid=BobSmith", true);
and
httpContext.RewritePath(
"http://mydomain.com/Users/Default.aspx?userid=BobSmith");

So, depending on the link the use types into the browser (i.e. whether or
not they include the last "/" after "BobSmith") the client browser gets the
wrong path to the images and stylesheets. I see there's a new 4th overload
for RewritePath, but the documentation isn't clear to me. I don't know if
there's a different way to be doing the same thing or not? Is this a bug
introduced between beta 2 and the final release of .NET 2.0? Can someone
tell me what I can do to avoid this problem?

Thanks
cpnet
Dec 5 '05 #1
0 1416

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2721
by: Guadala Harry | last post by:
I'd really appreciate it if someone would give me a"plain English" explanation of HttpContext.RewritePath(). I read the MSDN documentation, but still don't understand it. According to MSDN:...
8
1833
by: Jiho Han | last post by:
Can someone explain in layman's term, what HttpContext.RewritePath does? SDK doc explanation is kind of scant. Does it only affect the request processing for the duration of the processing(meaning...
1
1629
by: marcmiles | last post by:
It looks like postbacks cause a problem with HttpContext.RewritePath. I've read about the two solutions below, but the first one seems extensive, and the scond one seems too easy. I sent an email...
15
6666
by: James Higgs | last post by:
For a long time, our product has had a "vanity URLs" feature where nice URLs are mapped to ASPX files in an IHttpModule implementation, using HttpContext.RewritePath(). This has worked beautifully...
3
2895
by: asanford | last post by:
I want to create an ASP.NET web application that receives a form POST message, inspects the data, and reroutes the request to one of many different servers. I wrote an IHttpModule which...
0
1364
by: Martin | last post by:
asp.net 2.0 I have implemented the url rewriting using httpcontext.rewrite path( newpath, setbase) which all works fine in IE, but testing with fiddler ( www.fiddlertool.com) when you test...
2
2973
by: Steven Nagy | last post by:
Hi all, I have the following file: ~/cms/page.aspx Normally, if you hit a url like http://localhost/MyApp/cms/page.aspx?PageID=32 ... this would load content dynamically. No big deal, this is...
1
5145
by: jbitz | last post by:
Hi, This has got me really baffled. This has got me really baffled. When I run Dim url As String = HttpContext.Current.Request.Url.AbsolutePath.ToLower from Application_beginRequest in...
1
1796
by: mmorrison93 | last post by:
Thanks in advance for any help on this problem, but i have an HttpHandler that looks at the requested url and and tranfers context to a particular file. The problem is the transfer will only work...
0
7044
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7087
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.