Has anyone had any luck w/ using Request.Browser in ASP.NET 2.0? Specifically the Request.Browser.ScreenPixelsHeight, Request.Browser.ScreenPixelsWidth don't seem to return correct results. When I check these values they just report 640x480 which is not my current resolution (1600x1200). I tried it in FireFox and IE so it doesn't appear to be a browser issue. Is there anything I can do to make these properties return correct values? I tried to google for this info, but surprisingly there isn't much out there...
Thanks for any insight you can provide. MK
=================================== This list is hosted by DevelopMentor http://www.develop.com
Adrian Martin 23 August 2006 18:09:11 [ permanent link ]
The property you are requesting is actually a member of HttpCapabilitiesBase It's values are provided from the servers config files, NOT from the client itself - you would have to use javascript to retrieve client side values.
-----Original Message----- From: Discussion of building .NET applications targeted for the Web [mailtoOTNET-WEB@DISCUSS.DEVELOP.COM] On Behalf Of Mark Kucera Sent: Wednesday 23 August 2006 14:58 To: DOTNET-WEB@DISCUSS.DEVELOP.COM Subject: Request.Browser
Has anyone had any luck w/ using Request.Browser in ASP.NET 2.0? Specifically the Request.Browser.ScreenPixelsHeight, Request.Browser.ScreenPixelsWidth don't seem to return correct results. When I check these values they just report 640x480 which is not my current resolution (1600x1200). I tried it in FireFox and IE so it doesn't appear to be a browser issue. Is there anything I can do to make these properties return correct values? I tried to google for this info, but surprisingly there isn't much out there...
Thanks for any insight you can provide. MK
=================================== This list is hosted by DevelopMentor(r) http://www.develop.com
Opinions expressed in this email are those of the writer and not the company. E-mail traffic is monitored within Johnston Press and messages may be viewed. This e-mail and any files with it are solely for the use of the addressee(s). If you are not the intended recipient, you have received this e-mail in error. Please delete it or return it to the sender or notify us by email at postmaster@jpress.co.uk
=================================== This list is hosted by DevelopMentor http://www.develop.com
Afaik all of the browser capabilities are extracted from the http headers sent by the client to the server. Asp.net 2.0 contains a very powerful technology to accomplish this using a set of regular expressions, applied to the aforementioned headers: you could access the code for each one of them (and add you own, if needed) in the \v2.0.50727\CONFIG\Browsers folder, checking out every .browser file. You should see that ScreenPixelsWidth/Height is available only for a small set of known user agent, namely Treo600 and other mobile devices which, in fact, send these informations embedded in one of the http headers they use. To extract those values from the browsers not supported by this mechanism you should use javascript, if available.
Mark Kucera wrote:> Has anyone had any luck w/ using Request.Browser in ASP.NET 2.0?> Specifically the Request.Browser.ScreenPixelsHeight,> Request.Browser.ScreenPixelsWidth don't seem to return correct results.> When I check these values they just report 640x480 which is not my> current resolution (1600x1200). I tried it in FireFox and IE so it> doesn't appear to be a browser issue. Is there anything I can do to> make these properties return correct values? I tried to google for this> info, but surprisingly there isn't much out there...>
Thanks for any insight you can provide.> MK>
===================================> This list is hosted by DevelopMentor http://www.develop.com>
Thanks Efran, this does help. I am familiar w/ the http headers and was figuring this info must be coming from there, but as to how I wasn't sure. It makes sense that these properties would be more applicable to hand-held devices and such, however it would be nice to see a little bit more detailed msdn documentation on this class and these methods like you've provided below.
Thanks for your input MK
-----Original Message----- From: Discussion of building .NET applications targeted for the Web [mailtoOTNET-WEB@DISCUSS.DEVELOP.COM] On Behalf Of Efran Cobisi Sent: Wednesday, August 23, 2006 10:12 AM To: DOTNET-WEB@DISCUSS.DEVELOP.COM Subject: Re: [DOTNET-WEB] Request.Browser
Hi Mark,
Afaik all of the browser capabilities are extracted from the http headers sent by the client to the server. Asp.net 2.0 contains a very powerful technology to accomplish this using a set of regular expressions, applied to the aforementioned headers: you could access the code for each one of them (and add you own, if needed) in the \v2.0.50727\CONFIG\Browsers folder, checking out every .browser file. You should see that ScreenPixelsWidth/Height is available only for a small set of known user agent, namely Treo600 and other mobile devices which, in fact, send these informations embedded in one of the http headers they use. To extract those values from the browsers not supported by this mechanism you should use javascript, if available.
Mark Kucera wrote:> Has anyone had any luck w/ using Request.Browser in ASP.NET 2.0?> Specifically the Request.Browser.ScreenPixelsHeight,> Request.Browser.ScreenPixelsWidth don't seem to return correct results.> When I check these values they just report 640x480 which is not my> current resolution (1600x1200). I tried it in FireFox and IE so it> doesn't appear to be a browser issue. Is there anything I can do to> make these properties return correct values? I tried to google for this> info, but surprisingly there isn't much out there...>
Thanks for any insight you can provide.> MK>
===================================> This list is hosted by DevelopMentor(r) http://www.develop.com>
Yes i can use a javascript to get the screen resolution but if i want to set the height and width of any of my page's control based on the client resolution then what should i do. If any body has an idea then let me know
S11223J2 Currently, Timberland is one of the most famous Timberland Classic brands. Throughout the 1990s, the popularity of the Timberland Kids Boot reached an important point. Also, in that time, the company added more mens Timberland 6 Inch products and lines to its catalog. Now, the prestige as a Timberland custom boots brand with excellent products is unquestionable. In preparation for the upcoming cold seasons, the company has launched its collection called Timberland Women's Boots, which is already available at the Timberland stores. http://www.timberlander.com/products_all.html
If you would like to report an abuse of our service, such as a spam message, please . Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .