Saturday, March 24, 2012

Server Variables

Hi - i'm trying to get my application to detect the user id the user is logging onto my application with.
In classic ASP it was easy
Request.ServerVariables("AUTH_USER")

but it just wont work for me in .net
I've tried...

Request.ServerVariables("AUTH_USER")

and

Request.ServerVariables.Item("AUTH_USER")

Neither of them work i get what appears to be a permissions problem
The error i get is "Request is not available in this context"
Then it says it cant show me teh source unless i set debug="true" - but i have in both page and web.config so i don't know what's going on there either!

Anyone?

CheersThe error is about the Request object itself. The rest of that statement doesn't matter until you can get access to Request. Request is available on any method within a Page or UserControl class. If your code is in another object, you can reference it with HttpContext.Current.Request.

0 comments:

Post a Comment