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

O

ocn0248

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>
 
B

Bruce Barker

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top