Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Request.Browser.MajorVersion.ToString() returns null on ASP.NET 2.0 Beta 1 and Beta 2

Reply
Thread Tools

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

 
 
ocn0248@hotmail.com
Guest
Posts: n/a
 
      05-02-2005
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>

 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      05-02-2005
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: oups.com...
> 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>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted Returns List and Reversed Returns Iterator ++imanshu Python 7 08-23-2008 04:25 AM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
Begin() applied on empty Vector returns NULL or non null value???? Col C++ 1 04-21-2006 01:12 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
block returns and hash element returns Trans Ruby 2 11-06-2005 12:15 PM



Advertisments