G
George G.
Hi there,
I am busy writing a new asp.net application and I am reusing some of my
existing asp functions and methods in a user control. I need access to
session, request and response in some of the functions and I can't find out
how to do it. Here is an example of what I do and I get the following
Cannot refer to an instance member of a class from within a shared method or
shared member initializer without an explicit instance of the class
on this line
client = Request.ServerVariables("HTTP_USER_AGENT")
Public Shared Function GetIEVersion() As Double
Dim IEVer, client, ver
client = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(1, client, "MSIE", 1) > 0 Then
IEVer = Split(client, ";", -1, 1)
ver = Split(Trim(IEVer(1)), " ")(1)
Else
ver = -9999
End If
Return ver
End Function
if I can find out how to include files like in classic ASP it would also do
it for me.
#include file = "inc\utils.asp" in asp = ? in asp.net
Regards,
George
I am busy writing a new asp.net application and I am reusing some of my
existing asp functions and methods in a user control. I need access to
session, request and response in some of the functions and I can't find out
how to do it. Here is an example of what I do and I get the following
Cannot refer to an instance member of a class from within a shared method or
shared member initializer without an explicit instance of the class
on this line
client = Request.ServerVariables("HTTP_USER_AGENT")
Public Shared Function GetIEVersion() As Double
Dim IEVer, client, ver
client = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(1, client, "MSIE", 1) > 0 Then
IEVer = Split(client, ";", -1, 1)
ver = Split(Trim(IEVer(1)), " ")(1)
Else
ver = -9999
End If
Return ver
End Function
if I can find out how to include files like in classic ASP it would also do
it for me.
#include file = "inc\utils.asp" in asp = ? in asp.net
Regards,
George