Warnings while converting to Visual Studio 2005

gopal99

New member
Joined
Dec 16, 2005
Messages
2
Programming Experience
10+
Hi,
I am converting existing vb.net application to Visual Studio 2005, I got multiple warnings, Here is one. Please let me know how to fix this. Thanks in advance.

Public Function fCheckBrowser( _
ByVal Request As System.Web.HttpRequest, _
ByVal BrowserName As String, _
ByVal BrowserVersion As String) As Boolean
' rewrite to set Properties instead of building a String thing
' Dim x As String
Dim s As String = ""
With Request.Browser
s &=
"Browser Capabilities" & vbCrLf
s &=
"Type = " & .Type & vbCrLf
s &=
"Name = " & .Browser & vbCrLf
s &=
"Version = " & .Version & vbCrLf
s &=
"Major Version = " & .MajorVersion & vbCrLf
s &=
"Minor Version = " & .MinorVersion & vbCrLf
s &=
"Platform = " & .Platform & vbCrLf
s &=
"Is Beta = " & .Beta & vbCrLf
s &=
"Is Crawler = " & .Crawler & vbCrLf
s &=
"Is AOL = " & .AOL & vbCrLf
s &=
"Is Win16 = " & .Win16 & vbCrLf
s &=
"Is Win32 = " & .Win32 & vbCrLf
s &=
"Supports Frames = " & .Frames & vbCrLf
s &=
"Supports Tables = " & .Tables & vbCrLf
s &=
"Supports Cookies = " & .Cookies & vbCrLf
s &=
"Supports VBScript = " & .VBScript & vbCrLf
s &=
"Supports JavaScript = " & .JavaScript & vbCrLf
s &= "Supports Java Applets = " & .JavaApplets & vbCrLf
s &=
"Supports ActiveX Controls = " & .ActiveXControls & vbCrLf
End With
Dim strBrowserName As String
Dim strBrowserVersion As String
Dim blnResult As Boolean
strBrowserName = UCase$(Trim$(BrowserName))
strBrowserVersion = Trim$(Replace(BrowserVersion,
".", String.Empty, , , CompareMethod.Binary))

Select Case False
Case strBrowserName = UCase$(Request.Browser.Browser)
Case strBrowserVersion < Trim$(Replace(Request.Browser.Version, ".", String.Empty, , , CompareMethod.Binary))
Case Else
blnResult = True
End Select
Return blnResult
End Function ' fCheckBrowser


The warning is on the bolded line, and it is "Public ReadOnly Property JavaScript() as boolean is obsolete, the recommended version is the EcmaScriptVersion.


Thanks,
 
Here is a more verbose error description:

"The recommended alternative is the EcmaScriptVersion property. A Major version value greater than or equal to 1 implies JavaScript support. http://go.microsoft.com/fwlink/?linkid=14202"

So I guess:

VB.NET:
Dim javascript As Boolean = .EcmaScriptVersion.Major >= 1
[COLOR=black]s &= [SIZE=2]"Supports JavaScript = "[/SIZE][SIZE=2] & javascript & vbCrLf[/SIZE][/COLOR]
 
Back
Top