Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi,
 
i have created 2 websites. 1> for pc. and 1> for mobile.
 
how to redirect a website if someone open from mobile devise. it should open a website of mobile.
 
and someone open from PC. it should open a website of PC.
 
Please Help.
Posted 20-Feb-13 21:23pm
Comments
NaVeN Kumar at 21-Feb-13 2:25am
   
Can you please elaborate your question...!
harshadptl4 at 21-Feb-13 2:29am
   
if i tries to open my website from PC. it should open - www.cricbuzz.com (EXAMPLE).
 
and if i tries to open my website from Mobile devise. it should open - m.cricbuzz.com (EXAMPLE).
 
GOT IT???

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can check the Request.Browser.IsMobileDevice property: MSDN[^] which should do it, but I wouldn't just do it - sometimes you want a mobile version on a PC (to cut out the crap and get to the meat of the webpage) and sometimes you want a PC version on your mobile (because the info isn't easily or obviously available on the mobile version)
 
The way this site does it is nice - there is a "mobile" link at the bottom which lets me override it, and a "Full Site" link at teh top of the mobile page to get back to PC. Perhaps, if you detect a mobile and ask which they prefer, and store the result in a cookie?
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150326.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100