UrlMappings...how can you tell???

J

jazzMan007

Hi All -

I'm using the new UrlMappings feature in an ASP.NET 2.0 application.
I'm using the unique urls, mapped to shared files, in the site map. So
for example, I have pages A, B, & C...all of which direct to a subpage,
D. The sitemap requires URLs to be unique, so to make sure the
navigation works, I've mapped AD, BD, & CD to D using the urlMappings
section in the web.config file.

So that all works fine an dandy. Now I'm working on page D, and when
I'm on AD, it posts back to D, not AD, which screws up the navigation.
The solution to this seems to be changing the action of the form from D
back to AD when the url is mapped.

So the question of the day is....how can you tell if the url has been
mapped? And can you tell what it should be? The RawUrl property of the
request contains AD + querystring, the Path property contains just D.
Currently I'm going down the road of comparing those 2 and extracting
what the action should be. I find it hard to believe that they left out
a way to tell if it has been mapped. The HttpRequest class does have a
RewrittenUrl property, but it's internal (gotta love Reflector). From
what I can tell, if that were public, a simple IsNullOrEmpty would
answer this whole thing!

Am I missing something? Or do I just have to manually crunch the
strings to find the mapping?

Thanks in advance,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top