Last post Feb 12, 2007 12:19 AM by colinbo
Jan 20, 2007 11:14 AM|jameshill|LINK
Does anybody have an good link for help with browser detection scripts.. I have a sample script that uses ''Request.Browser.Type'', but I dont know how to serve the right content based on the browser type. Basically I want the webpage to render correctly
on a mobile phone, but still want the users to see a funtional website on pc based browser.
Basic principal of what i'm trying to achieve.
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
ltlBrowserName.Text = Request.Browser.Type
If Request.Browser.Type = "PC Based Browser" Then
Serves Normal webpage to browser.
If Request.Browser.Type = "Mobile Phone" Then
Mobile Page Content
How should this be done, should I use a response re-direct to re-direct the user based on browser type.
Feb 01, 2007 02:23 AM|Siddero|LINK
Try using ((System.Web.Mobile.MobileCapabilities)Request.Browser).IsMobileDevice. May not work all the time though. Have a look at this thread: http://forums.asp.net/thread/1489593.aspx
Try searching the forum on the key 'IsMobileDevice' for other issues that people might have exprienced using it.
Hope that helps.
Feb 12, 2007 12:19 AM|colinbo|LINK
See the following documentation topic -
Redirecting to an ASP.NET Mobile Web Page.
One thing to note is that you will want to keep your mobile web pages separate from your desktop ASP.NET pages. The mobile web forms use a completely different set of controls that derive but have some stark differences (or rather limitations) from their
ASP.NET desktop browser counterparts.