I am developing a small website that I want to be able to view both on a computer and on a mobile device. I understand that I can easily change my CSS code for most mobile devices using the following:
<link rel="stylesheet" type="text/css" media="handheld" href="foo_mobile.css"> <link rel="stylesheet" type="text/css" media="screen" href="foo_screen.css">
However, I really want to replace _layout.cshtml based on the type of browser (screen and handheld - plus iPhone).
I have seen many sites that redirect mobile devices to a subdomain, such as m.xyzCorp.com , but would like to avoid this if possible.
Is there any sample code or tutorials? my google-foo is weak today.
TIA
source share