Last post Aug 17, 2010 11:34 AM by amar_j
Mar 31, 2009 02:40 AM|Jashu|LINK
Here i'm creating two sites for internet version and mobile version.
When the user enters site name, we would detect the mobile browser automatically and redirect the user to mobile version of the site .
is it possible??
if yes, please tell the way i need to develop the application for mobile web application
thanks in advance,
Mar 31, 2009 05:42 AM|tatsky|LINK
If you are developing for newer/current mobile devices many now have quite good browsers, so you can get away with creating different CSS layouts for web and mobile. You can obviously do a lot more and have completely different xhtml and make the mobile
version very lightweight.
To detect the browser being used you can just use Request.Browser and look at the capabilities of the brower. Do a google search for Request.Browser and you will get a plethora of excellent tutorials and walk throughs.
Once you have detected your browser just emit your css file of choice, or redirect to your mobile/web version of the application.
I hope this helps
Mar 31, 2009 05:57 AM|binobose|LINK
You can use Request.Browser to check for the browser.
Mar 31, 2009 07:03 AM|Jashu|LINK
now i'm able to find the browser, but how we can navigate to Mobile site
Mar 31, 2009 10:12 AM|tatsky|LINK
Well once you know what the browser is then just redirect the user where you want them. So for example in pseudo code
if( Browse Is MObile Device)
I would suggest you have this in a base page inherited in all pages so that regardless of what page is called this check is done. Just oncase someone requests http://www.mysite.com/folder/folder2/somepage.aspx from their mobile device.
You can then have your mobile site as a seperate website.
Does that help ?
Aug 17, 2010 11:34 AM|amar_j|LINK
You can start using 51degrees.mobi Foundation .NET API. This is the exact solution provided by 51degrees.mobi foundation
It is a open source available here
It easily detects if the request is coming from any mobile device and redirects user to mobile landing page. It has some user friendly samples to try out.
- Thank You