开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜