HOW TO: Get from the aspx context the current authenticate username ?

  • Thread starter Thread starter Tiraman
  • Start date Start date
T

Tiraman

Hi,

in vb6 we could use the GetObjectContext("Request") of the
ASPTypeLibrary.Request

in order to get the ServerVariables("XXX") from the asp to the dll .

can we do that in aspx and vb dot net dll ?

the question is if there is a context switch between aspx to the dot net dll
?

10x
 
Hi Tiraman,

From your description, you'd like to referece the current processing Web
Request's Context in asp.net application so as to retrieve the
ServerVariables from the Request object, yes?

I think the HttpContext.Current member in ASP.NET is the one you need, it
provide the reference to the current ASP.NET request's Context and it has
many members such as Request, Response. Session, Server...
You can view the following weblink for detailed reference:
#HttpContext.Current Property
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebHttpContext
ClassCurrentTopic.asp?frame=true

So we can use the
HttpContext.Current.Request.ServerVariables to get ServerVariables

Also, the ASP.NET has its own Authentication and Authorization mechinasm
different from
classic ASP , here are some further references on ASP.NET's Authentication
and Authorization:
#ASP.NET Authentication
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconASPNETAuthenticati
on.asp?frame=true

#ASP.NET Authorization
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaspnetauthorizatio
n.asp?frame=true

Hope also helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Hi Steven ,

10x for the information

I will go over it and if I will have more questions I will ask .

bye and 10x again :-)

Tiraman
 
Back
Top