Hello igotyourdotnet,
As for client browser detection, generally server-side application(http
based web application) will use the http UserAgent header for reference.
For example, IE desktop browser will send the following http UserAgent
header
=========
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322;
..NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2)
=========
And in ASP.NET, it use a browser setting to maintain an supported
browser/device list. This list originally configured in machine.config's
<browserCaps> element(in .net 2.0) or through the .browser files under
"browsers" folder under framework folder (for .net 2.0). At runtime,
ASP.NET will search for the certain browser type that matchs the useragent
http header and load the corresponding browser info into HttpRequest's
Browser property for later browser specific processing use. However, it is
still our duty to determine how we should deal with the control or page's
output according to the browser type. In ASP.NET 2.0, it provide a adapter
based archietcture for dealing with page/control rendering for different
browser.
#Control Adapters
http://msdn.microsoft.com/msdnmag/issues/06/10/ExtremeASPNET/
#ASP.NET Browser Registration Tool (Aspnet_regbrowsers.exe)
http://msdn2.microsoft.com/en-gb/library/ms229858(VS.80).aspx
For your scenario, if you just want to provide different html output for
different browser/device(mobile or not) and do not want to use the
ASP.NET's multi-browser support, I think you need to maintain a own browser
list and detect browser type through the http useragent header or the
Browser property as Gregory has mentioned:
http://www.codeproject.com/aspnet/browsercaps.asp
http://aspnet.4guysfromrolla.com/articles/120402-1.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.