473,385 Members | 1,942 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,385 software developers and data experts.

MVC Routing question

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
--

Sep 15 '08 #1
2 850
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
--

Sep 15 '08 #2
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
--
Sep 16 '08 #3

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

Similar topics

3
by: Shiv Agarwal | last post by:
Hi, I am writing a .NET application in C#. I have to display the routing table in some formatted NMS way. Anyhow the issue is that, whenever the routing table changes I want to get an event....
0
by: Wilfried Hoermann | last post by:
I'm trying to use WS-Routing to a Web Service which is protected by https and requiring Client Certificates Without Client Certificates it seems to work but with Client Certificates I get an 403...
1
by: Tom Weston | last post by:
Help I have created a report in access and wish to use a routing slip to email it to my line management, how can I do that? I have searched the web but not found a way to add a routing slip,...
3
by: jgretz | last post by:
Background: My program connects to an external web service. Normally this is done over a high speed lan connection, but in the event that the lan is down, it supports using 1 or many dial up...
2
by: ricky | last post by:
Hi, I am student and I am doing a final year project on Zig-bee. I have to write low energy routing algorithms. I need to write routing algorithm for LEACH. If anybody can help with some links...
0
by: devidevi | last post by:
hello sir, i'm doing a project in Mobile Adhoc network in ns2 simulator i have to perform routing with AODV.. my problem is i have to disable certain nodes ( in a 20 node topology) from...
0
by: vince | last post by:
Until December, 31st, 2008 companies may obtain a free Developer License of the JOpt.NET Vehicle Routing Library The Vehicle Routing Initiative aims on software vendors that plan to incorporate...
0
by: vince | last post by:
Until December, 31st, 2008 companies may obtain a free Developer License of the JOpt.SDK Vehicle Routing Library The Vehicle Routing Initiative aims on software vendors that plan to incorporate...
0
by: shekharban | last post by:
Hi, Below is the raw socket program for sending routing header in ipv6 domain. My source address is fe80::21d:9ff:fe17:58c7 and destination address is fe80::21d:9ff:fe17:5d0e in the below...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.