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

ASP.NET, CSS, and Netscape 7.1

P: n/a
I was testing out a page of mine that displays the information from
Page.Request.Browser. It works exactly as I expected in Internet Explorer
and Netscape 4.75 (I didn't expect much in Netscape 4.75, but I got some
stuff). However, Netscape 7.1 gave me some strange stuff, including the
following:

1. It gave the Version as 5.0 rather than 7.1, and the Type as Netscape5
2. ASP.NET did not send any CSS other than the constant part that I entered
manually in the .aspx file

I am assuming that strange thing #1 is simply because it sends a strange
User-Agent string. However, strange thing #2 I have no explanation for,
since even though Netscape 7.1 does not support ALL the CSS I use, it does
support some. I would also like to know what ASP.NET uses to determine
whether or not to send CSS, since Page.Request.Browser does not have a
property that specifies whether the client supports CSS. Any help would be
appreciated.

NOTE: The page I was testing out is located at the following URL:
http://www.nathansokalski.com/Browser.aspx

--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Mar 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a


--
Terry Burns
http://TrainingOn.net
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I was testing out a page of mine that displays the information from
Page.Request.Browser. It works exactly as I expected in Internet Explorer
and Netscape 4.75 (I didn't expect much in Netscape 4.75, but I got some
stuff). However, Netscape 7.1 gave me some strange stuff, including the
following:
1. It gave the Version as 5.0 rather than 7.1, and the Type as Netscape5 What gave 5.0 ?, can you be more specific ?

2. ASP.NET did not send any CSS other than the constant part that I
entered manually in the .aspx file Are you saying that the in-line styles did not render to Netscape.?
I am assuming that strange thing #1 is simply because it sends a strange
User-Agent string. However, strange thing #2 I have no explanation for,
since even though Netscape 7.1 does not support ALL the CSS I use, it does
support some. I would also like to know what ASP.NET uses to determine
whether or not to send CSS, since Page.Request.Browser does not have a
property that specifies whether the client supports CSS. Any help would be
appreciated.
You dont specify what version of ASP.NET you are using?

ASP.NET 2003 should have no problems rendering in-line styles to Explorer
or Netscape. as for CSS stylesheets, providing the browser supports it,
you should have no problem. ASP.NET controls know how to render
themselves.


NOTE: The page I was testing out is located at the following URL:
http://www.nathansokalski.com/Browser.aspx

--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Mar 12 '06 #2

P: n/a
>> 1. It gave the Version as 5.0 rather than 7.1, and the Type as Netscape5
What gave 5.0 ?, can you be more specific ? Page.Request.Browser.Version returned the value "5.0"
Page.Request.Browser.Type returned the value "Netscape5"
2. ASP.NET did not send any CSS other than the constant part that I
entered manually in the .aspx file

Are you saying that the in-line styles did not render to Netscape.?

Yes, that is exactly what I am saying. The output rendered for the Label
Controls was like the following:

Netscape recieved the output like the following:
<span>Browser</span>

Internet Explorer recieved the output like the following:
<span style="background-color:Silver;width:175px;">Browser</span>
You dont specify what version of ASP.NET you are using? I am using ASP.NET 1.1.4322

I don't know whether or not you have Netscape 7.1 on your machine, but if
you do you can try it out and do a view Page Source to see the results for
yourself using the link I included in my original message. Something that I
did find on the web at
http://www.code-magazine.com/article...printmode=true
mentions that this is true for most non-Microsoft browsers, as in the
following paragraphs that I have copied from the page:
The downside to checking the type of the passed HtmlTextWriter is that
virtually all non-Microsoft browsers, including Netscape versions that do
support CSS, pass Html32TextWriter to the Render method. So even a Netscape
6 browser would receive HTML 3.2, even though it supports CSS perfectly. The
only way to get around this is by changing machine.config to add:

tagwriter=System.Web.UI.HtmlTextWriter

to each browser that supports CSS. This is risky though, because this may
not only impact CSS support. So test if your application still works
properly after changing machine.config.

If you know of any better workarounds than modifying the machine.config file
(well, I would probably be forced to add the stuff to my web.config since my
site is on a webhosting service and therefore do not have access to
machine.config), please let me know. I think that there should be a
Page.Request.Browser.CSS property, but since there isn't, I don't know what
else to do. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Terry Burns" <me@mine.com> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...

--
Terry Burns
http://TrainingOn.net
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I was testing out a page of mine that displays the information from
Page.Request.Browser. It works exactly as I expected in Internet Explorer
and Netscape 4.75 (I didn't expect much in Netscape 4.75, but I got some
stuff). However, Netscape 7.1 gave me some strange stuff, including the
following:


1. It gave the Version as 5.0 rather than 7.1, and the Type as Netscape5

What gave 5.0 ?, can you be more specific ?

2. ASP.NET did not send any CSS other than the constant part that I
entered manually in the .aspx file

Are you saying that the in-line styles did not render to Netscape.?
I am assuming that strange thing #1 is simply because it sends a strange
User-Agent string. However, strange thing #2 I have no explanation for,
since even though Netscape 7.1 does not support ALL the CSS I use, it
does support some. I would also like to know what ASP.NET uses to
determine whether or not to send CSS, since Page.Request.Browser does not
have a property that specifies whether the client supports CSS. Any help
would be appreciated.


You dont specify what version of ASP.NET you are using?

ASP.NET 2003 should have no problems rendering in-line styles to Explorer
or Netscape. as for CSS stylesheets, providing the browser supports it,
you should have no problem. ASP.NET controls know how to render
themselves.


NOTE: The page I was testing out is located at the following URL:
http://www.nathansokalski.com/Browser.aspx

--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Mar 12 '06 #3

P: n/a
Nathan Sokalski wrote:
The only way to get around this is by
changing machine.config to add:
tagwriter=System.Web.UI.HtmlTextWriter

to each browser that supports CSS. This is risky though, because this
may not only impact CSS support. So test if your application still
works properly after changing machine.config.


This may interest you:-
"BrowserCaps update for modern browsers,
http://slingfive.com/pages/code/browserCaps/ "

Andrew
Mar 13 '06 #4

P: n/a
Thanks! That is probably the best update I've seen, I want to know why
Microsoft doesn't give updates like that! Thanks again, I really appreciate
it, I will add it to my web.config right away.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Andrew Morton" <ak*@in-press.co.uk.invalid> wrote in message
news:Or****************@TK2MSFTNGP11.phx.gbl...
Nathan Sokalski wrote:
The only way to get around this is by
changing machine.config to add:
tagwriter=System.Web.UI.HtmlTextWriter

to each browser that supports CSS. This is risky though, because this
may not only impact CSS support. So test if your application still
works properly after changing machine.config.


This may interest you:-
"BrowserCaps update for modern browsers,
http://slingfive.com/pages/code/browserCaps/ "

Andrew

Mar 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.