By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,594 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,594 IT Pros & Developers. It's quick & easy.

desktop or mobile browser

P: n/a
I have a web app that I want to make the pages render correctly based on what
type of browser is connected. How can I determine if the browser is the
desktop IE version or a handheld device version?

Nov 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
http://msdn.microsoft.com/library/de...inwebforms.asp

:-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside the box!
*************************************************
"igotyourdotnet" <ig************@nospam.nospamwrote in message
news:07**********************************@microsof t.com...
>I have a web app that I want to make the pages render correctly based on
what
type of browser is connected. How can I determine if the browser is the
desktop IE version or a handheld device version?

Nov 16 '06 #2

P: n/a
that doesn't tell me if its a handheld device such as a blackberry browser
(IE version) or a desktop IE version. I ran the URL below in a test web form
and the params are the same except for the Minor version, the blackberry is
..8 and the desktop is 6. Thats the only difference. Is that what I need to
look for though to determine what page to direct them to or stylesheet to use
on the web form?
"Cowboy (Gregory A. Beamer)" wrote:
http://msdn.microsoft.com/library/de...inwebforms.asp

:-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside the box!
*************************************************
"igotyourdotnet" <ig************@nospam.nospamwrote in message
news:07**********************************@microsof t.com...
I have a web app that I want to make the pages render correctly based on
what
type of browser is connected. How can I determine if the browser is the
desktop IE version or a handheld device version?


Nov 16 '06 #3

P: n/a
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
<browserCapselement(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/is...ExtremeASPNET/

#ASP.NET Browser Registration Tool (Aspnet_regbrowsers.exe)
http://msdn2.microsoft.com/en-gb/lib...58(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/subscripti...ult.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/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '06 #4

P: n/a
thanks, I'll take a look at the information below.


"Steven Cheng[MSFT]" wrote:
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
<browserCapselement(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/is...ExtremeASPNET/

#ASP.NET Browser Registration Tool (Aspnet_regbrowsers.exe)
http://msdn2.microsoft.com/en-gb/lib...58(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/subscripti...ult.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/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.