URL Mapping

G

Guest

Hello All,

In my app I have a page that shows articles something like
showarticle.aspx?articleid=xxxx, I want that it looks like:
/showarticle/article-one-title.aspx and so forth, so I was thinking to use
the “new†asp.net 2.0 URL Mapping instead of write a http module to handle
this.
I set the settings this way: <urlMappings configSource="Mappings.xml" /> and
I‘m planning to update the xml file every time a new article is added. I’m
not happy with this way, will be better to use the HTTP Handler? Any
recommendation?

Thanks!
 
L

Laurent Bugnion

Hi,
Hello All,

In my app I have a page that shows articles something like
showarticle.aspx?articleid=xxxx, I want that it looks like:
/showarticle/article-one-title.aspx and so forth, so I was thinking to use
the “new†asp.net 2.0 URL Mapping instead of write a http module to handle
this.
I set the settings this way: <urlMappings configSource="Mappings.xml" /> and
I‘m planning to update the xml file every time a new article is added. I’m
not happy with this way, will be better to use the HTTP Handler? Any
recommendation?

Thanks!

It really depends on your use case. If a program can deduct the mapping
according to the article's name or content, then I would rather
recommend going with a HttpModule. It's quite easy to do in 2.0 anyway.
The urlMappings solution is easier, but if you must update and upload
the config file every few days, it might be too much of a trouble.

Note additionally that every modification to the web.config file causes
the application to restart, and all existing sessions are closed. In a
productive environment, it might not be possible at all.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp

HTH,
Laurent
 
G

Guest

Thanks so much for your advice. I was afraid for the app restart too.

Will be nice to be able to write in the future something like this:
<urlMappings configSource="GetMapingXMl.aspx" /> and this page will build the
xml with the updated mappings ;-) hehehe don't you think?.
 
L

Laurent Bugnion

Hi,
Thanks so much for your advice. I was afraid for the app restart too.

Will be nice to be able to write in the future something like this:
<urlMappings configSource="GetMapingXMl.aspx" /> and this page will build the
xml with the updated mappings ;-) hehehe don't you think?.

I doubt that will happen, considering how easy it is to use HttpModules
in ASP.NET 2.0 to rewrite URLs, and also how many solutions already
exist on internet.

Greetings,

Laurent
 

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,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top