Recently, I have been using Jquery-Mobile + MVC for Mobile Web. I have some experiences and experiences.
The following describes how to reject computer access to a mobile website.
The browser on the computer is different from the browser kernel on the mobile phone. This is my idea of rejecting access.
Below is a method that I have encapsulated to reject access
IsMobile (strUserAgent! = (System. web. httpContext. current. request. browser. isMobileDevice = | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains () | strUserAgent. contains (} View Code
Below is a test page in MVC
The Request. UserAgent can be used to obtain the complete proxy string of the current client. I am currently using a Google browser and can see an error page defined by myself.
Then, the test is successful if you use Android or apple for access.
Because of the layout and so on, the mobile website is completely different from the PC end, so you need to filter the website. I hope this simple method can help you.