Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
NaVeN Kumar 21-Feb-13 2:25am    
Can you please elaborate your question...!
harshadcse 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

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?
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900