Request.Browser.MajorVersion.ToString() returns null on ASP.NET 2.0 Beta 1 and Beta 2

Discussion in 'ASP .Net' started by ocn0248@hotmail.com, May 2, 2005.

  1. Guest

    The code bellow must be executed under safari web-browser.

    I need to know how I can get the major version of the safari
    web-browser.

    Thanks in advance

    vb.net code
    Partial Class SafariTest
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    Label1.Text = "Request.Browser.MajorVersion.ToString():" +
    Request.Browser.MajorVersion.ToString()

    End Sub
    End Class

    <%@ Page Language="VB" AutoEventWireup="false"
    CodeFile="SafariTest.aspx.vb" Inherits="SafariTest" %>

    aspx code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" runat="server"
    Text="Label"></asp:Label><br />

    </div>
    </form>
    </body>
    </html>
     
    , May 2, 2005
    #1
    1. Advertising

  2. Bruce Barker Guest

    update the browsercaps section in machine.config

    the agent string for safari look like:

    Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/xx (KHTML, like
    Gecko) Safari/yy

    where xx is the os build number and yy is briowser build number


    -- bruce (sqlwork.com)


    <> wrote in message
    news:...
    > The code bellow must be executed under safari web-browser.
    >
    > I need to know how I can get the major version of the safari
    > web-browser.
    >
    > Thanks in advance
    >
    > vb.net code
    > Partial Class SafariTest
    > Inherits System.Web.UI.Page
    >
    > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    > Label1.Text = "Request.Browser.MajorVersion.ToString():" +
    > Request.Browser.MajorVersion.ToString()
    >
    > End Sub
    > End Class
    >
    > <%@ Page Language="VB" AutoEventWireup="false"
    > CodeFile="SafariTest.aspx.vb" Inherits="SafariTest" %>
    >
    > aspx code
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    > "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head runat="server">
    > <title>Untitled Page</title>
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > <asp:Label ID="Label1" runat="server"
    > Text="Label"></asp:Label><br />
    >
    > </div>
    > </form>
    > </body>
    > </html>
    >
     
    Bruce Barker, May 3, 2005
    #2
    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. Roger Twomey
    Replies:
    2
    Views:
    2,991
    bruce barker
    Jun 11, 2004
  2. Sandy
    Replies:
    1
    Views:
    580
    Craig Deelsnyder
    Jun 11, 2004
  3. TJS
    Replies:
    1
    Views:
    693
  4. vizlab
    Replies:
    3
    Views:
    4,214
    Michael Bar-Sinai
    Oct 17, 2007
  5. Fergus McMenemie

    LibXML element->toString vs document->toString

    Fergus McMenemie, Jul 12, 2012, in forum: Perl Misc
    Replies:
    5
    Views:
    621
    Fergus McMenemie
    Jul 17, 2012
Loading...

Share This Page