473,324 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

UrlMappings...how can you tell???

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

Nov 20 '05 #1
1 1608
Check out the Request.RawUrl property.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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

Nov 20 '05 #2

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

Similar topics

8
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi...
1
by: Peter Larsson | last post by:
I'm testing the 2.0 Beta, I'm using Visual Web Developer Express Edition, running on windows 2000 server. When I run my site with the built in web-server the UrlMappings work great, but when I...
1
by: Alexander Widera | last post by:
Hi, is there something new in .net 2.0 about the topic "urlMappings" regarding dynamic url "redirection" ? I want to call "/testpage/topic1/new.aspx" and it should redirect to...
2
by: Luke Dalessandro | last post by:
I have an application with the following layout /root/ /root/Default.aspx /root/web.config /root/child/ /root/child/web.config web.config has a custom configuration section "testSection"...
0
by: Rune B | last post by:
Hey Group Why does this urlMapping work just fine on the development webserver, but not at the IIS (6.0) ? <urlMappings enabled="true"> <add url="~/srs"...
0
by: Bill | last post by:
On an ASP.NET 2.0 server, is there a way I can use urlMappings with Classical ASP pages? The web.config file, in my web root, is this: <?xml version="1.0" ?> <configuration...
1
by: Nathan Sokalski | last post by:
I am using the <urlMappingselement in my Web.config file as follows: <urlMappings enabled="true"> <add url="~/worldnews.aspx" mappedUrl="~/viewlinks.aspx?category=World+News&section=Main"/>...
3
by: Magdoll | last post by:
I was trying to map various locations in a file to a dictionary. At first I read through the file using a for-loop, but tell() gave back weird results, so I switched to while, then it worked. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.