J
Jason Hawthorne
I am trying to get this code to work in a class file that I use in all
of my pages.
Public Shared Function Check_Site() As String
Dim arr() As String
Dim coll As NameValueCollection
coll = Request.ServerVariables
arr = coll.GetValues("SERVER_NAME")
Select Case arr(0)
Case "site1.domain.com"
Check_Site = "THISSITE"
Case "site2.domain.com"
Check_Site = "THATSITE"
End Select
End Function
Currently the error I get is "Name 'request' is not declared" in the
class file.
But if I move the code to the aspx file the error goes away. The only
problem is I need to use this code in a lot of pages, so it needs to be
in a class file in a public shared function. How can I go about doing
this?
of my pages.
Public Shared Function Check_Site() As String
Dim arr() As String
Dim coll As NameValueCollection
coll = Request.ServerVariables
arr = coll.GetValues("SERVER_NAME")
Select Case arr(0)
Case "site1.domain.com"
Check_Site = "THISSITE"
Case "site2.domain.com"
Check_Site = "THATSITE"
End Select
End Function
Currently the error I get is "Name 'request' is not declared" in the
class file.
But if I move the code to the aspx file the error goes away. The only
problem is I need to use this code in a lot of pages, so it needs to be
in a class file in a public shared function. How can I go about doing
this?