ASP.NET MVC 3 and content based on geographical location
I would l开发者_运维百科ike to make ASP.NET MVC 3 page displaying different view depending on geolocation. For example, US visitors should see View1, and the rest of the world should see View2.
I would appreciate any advice you may have!
You may take a look at the following blog post. It presents a very nice technique that allows you to render appropriate view based on browser capabilities (whether its mobile or not) by using a custom view engine. This technique could be very easily tweaked so that instead of using the UserAgent header you would use the IP address of the client and based on its location resolve to the appropriate view. You will also need a GeoLocation service or database which will allow you to determine the location of the given IP address.
精彩评论