We must remember, in this connection, that the web server of Visual Studio does not accept remote requests and the emulator, in fact, is another remote machine: for this reason, we load our website on a real IIS server, so that it can reach in the network.Here are the links to the most popular emulators for testing:
Windows Phone (Windows Phone SDK);
Opera Mobile Emulator;
Apple Safari, with the user agent set to iPhone;
FireFox with FireFox User Agent Switcher.
Having said this, we can begin to try to move forward.
Build mobile web applications with ASP.NET WebForm
We enter the heart of our problem. Create a new website in Visual Studio. For now, we'll start with ASP.NET WebForm and then continue with ASP.NET MVC.
Let's start by defining our two master page, called "MasterPage.master" and "MasterPage-Mobile.master." ASP.NET WebForm is used to define the master page also programmatically, through the event Pre_Init.
Notwithstanding that, we could take different paths to solve this problem (how to create a base class from which all pages must inherit), the most elegant and less invasive is to build an HttpModule. The HttpModule are an important part of the architecture of ASP.NET, they allow, in a pluggable, to intercept application states (and therefore demand). Specifically, we intercept the PreRequestHandlerExecute event, which occurs when ASP.NET has already established the HttpHandler that must perform the request, but has not yet performed effectively. At this point, we can access the instance of the page through the properties of CurrentHandler HttpContext, in order to intercept the event Pre_Init of the page and perform the change of master page. Here is the code you need: http://www.prlog.org/11990799-local-app-broker-special-discount-now.html