ASP.NET, CSS, and Netscape 7.1

Discussion in 'ASP .Net Building Controls' started by Nathan Sokalski, Mar 12, 2006.

  1. 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

    http://www.nathansokalski.com/
    Nathan Sokalski, Mar 12, 2006
    #1
    1. Advertising

  2. Nathan Sokalski

    Terry Burns Guest

    --
    Terry Burns
    http://TrainingOn.net
    "Nathan Sokalski" <> wrote in message
    news:%...
    >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
    >
    > http://www.nathansokalski.com/
    >
    Terry Burns, Mar 12, 2006
    #2
    1. Advertising

  3. >> 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/articleprint.aspx?quickid=0309091&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

    http://www.nathansokalski.com/

    "Terry Burns" <> wrote in message
    news:...
    >
    >
    > --
    > Terry Burns
    > http://TrainingOn.net
    > "Nathan Sokalski" <> wrote in message
    > news:%...
    >>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
    >>
    >> http://www.nathansokalski.com/
    >>

    >
    >
    Nathan Sokalski, Mar 12, 2006
    #3
  4. 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
    Andrew Morton, Mar 13, 2006
    #4
  5. 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

    http://www.nathansokalski.com/

    "Andrew Morton" <> wrote in message
    news:OrGfO%...
    > 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
    >
    Nathan Sokalski, Mar 13, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski

    ASP.NET, CSS, and Netscape 7.1

    Nathan Sokalski, Mar 12, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    465
    Nathan Sokalski
    Mar 13, 2006
  2. Tom
    Replies:
    0
    Views:
    483
  3. Mickey Segal
    Replies:
    1
    Views:
    644
    Mickey Segal
    May 21, 2004
  4. Fred Camper
    Replies:
    2
    Views:
    421
    Jukka K. Korpela
    Aug 16, 2003
  5. yaktipper
    Replies:
    10
    Views:
    264
    Richard Cornford
    Jul 10, 2003
Loading...

Share This Page