Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > MVC Routing question

Reply
Thread Tools

MVC Routing question

 
 
Matthias S.
Guest
Posts: n/a
 
      09-15-2008
Hi there,

I'm going to develop my first application (blog type of thing) using
MVC. Now I have a question about routing. I'd like to implement a
globalization pattern like this:

http://mydomain/en/about (for the english about page)
and
http://mydomain/de/about (for the german about page)

The language code (in the above case 'en' or 'de') should be persisted
to a cookie. Whenever a page is called which doesn't have the language
portion in the URL, I want to lookup the value in the cookie. If there
is no cookie, I'd like to lookup the language supported by the browser
and rebuild the url. After that, I'd write the cookie.

How would I set up routing for a scenario like this?

Thanks in advance!

Matthias
--

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      09-15-2008
just supply a custom MvcRouteHandler

-- bruce (sqlwork.com)


"Matthias S." wrote:

> Hi there,
>
> I'm going to develop my first application (blog type of thing) using
> MVC. Now I have a question about routing. I'd like to implement a
> globalization pattern like this:
>
> http://mydomain/en/about (for the english about page)
> and
> http://mydomain/de/about (for the german about page)
>
> The language code (in the above case 'en' or 'de') should be persisted
> to a cookie. Whenever a page is called which doesn't have the language
> portion in the URL, I want to lookup the value in the cookie. If there
> is no cookie, I'd like to lookup the language supported by the browser
> and rebuild the url. After that, I'd write the cookie.
>
> How would I set up routing for a scenario like this?
>
> Thanks in advance!
>
> Matthias
> --
>
>

 
Reply With Quote
 
 
 
 
Matthias S.
Guest
Posts: n/a
 
      09-16-2008
Hi Bruce,

thanks for your reply. I've been googeling but recources on how to
provide a custom MvcRouteHandler seem to be pretty little around. Could
you recommend some further reading?

Thanks again,

Matthias
--



bruce barker wrote:

> just supply a custom MvcRouteHandler
>
> -- bruce (sqlwork.com)
>
>
> "Matthias S." wrote:
>
> > Hi there,
> >
> > I'm going to develop my first application (blog type of thing) using
> > MVC. Now I have a question about routing. I'd like to implement a
> > globalization pattern like this:
> >
> > http://mydomain/en/about (for the english about page)
> > and
> > http://mydomain/de/about (for the german about page)
> >
> > The language code (in the above case 'en' or 'de') should be
> > persisted to a cookie. Whenever a page is called which doesn't have
> > the language portion in the URL, I want to lookup the value in the
> > cookie. If there is no cookie, I'd like to lookup the language
> > supported by the browser and rebuild the url. After that, I'd write
> > the cookie.
> >
> > How would I set up routing for a scenario like this?
> >
> > Thanks in advance!
> >
> > Matthias
> > --
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No MVC Project Template after installing ASP.NET MVC 1.0 Crazy Cat ASP .Net 1 09-03-2009 08:02 PM
Why asp.net MVC cannot using "-" in url routing weijie.zhang ASP .Net 2 02-05-2009 08:31 AM
WebForms X MVC? Why MVC? Give me reasons to migrate my web apps to it please. Pros x Cons! Thanks! Paulo ASP .Net 3 12-04-2008 03:00 AM
differences between Spring WebFlow,Spring MVC,and String Portlet MVC? rmn190 Java 2 01-10-2008 02:27 AM
exchange routes between global IP routing table and VRF routing table zher Cisco 2 11-04-2004 11:28 PM



Advertisments