i have made an application in asp.net mvc3/c#/Razor , now i want to implement new template for the same application and i want to use the same controller logic but views will be different how i will do this ? . For example : if some visits my site from UAE i want to to template A but if someone else views my site anywhere else i want to show him my template B . Is there any way to have same controllers but different views in asp.net mvc 3
Share
There’s a NuGet package for you. And in ASP.NET MVC 4 it’s built-in. This package tests the user agent in order to serve mobile versions of the views. It implements a custom view engine for this. It could be extended so that instead of using the user agent you use the Request.UserHostAddress (IP) in order to dispatch to the proper folder. As far as the mapping between the user IP and a country is concerned, well, that’s something you will have to implement yourself or use an existing public API.