Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when complienly is Name 'Request' is not declared. 1

Status
Not open for further replies.

jondel81

Technical User
Jul 27, 2003
71
US
Error when compiling is Name 'Request' is not declared.

The code goes something like this:
Code:
Public Class sharedfunctions
    Shared Function getusername()
        Dim uid, username
        Const domainname = "CAREALOTPETS"
        Dim domainlen
        domainlen = Len(domainname)
        uid = LCase(Request.ServerVariables("REMOTE_USER"))
        getusername = Mid(uid, domainlen + 2)
    End Function
End Class

Any ideas? Not sure how to declare 'request'.

------
 
If this is in a custom class (not in a page's code-behind), look at:

System.Web.HttpContext.Current.Request

You may have to add a reference to System.Web if it's not already there.

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top