Can't get HttpContext.Current.User.Identity to work in my WebMatrix project

maria-happy

New Member
I want to capture the user opening my page in an internal Windows AD network.I think I've tried everything:\[code\]@{// other codestring user123 = HttpContext.Current.User.Identity;}\[/code\]and also\[code\]@{// other code<script> var user123 = HttpContext.Current.User.Identity;</script>}\[/code\]And trying to use that later inside my HTML code.Or passing it as a parameter to a stored procedure inside my razor block.Nothing. Either empty, runtime error, or undefined.Note1: \[code\]HttpContext\[/code\] is recognized by WebMatrix as an element.Note2: I enabled Windows Authentication in the server.Note3: My head is spinning from this.Note4: I'm a total rookie, as I'm just getting started with this.Note5: I tried \[code\]Page.Current...\[/code\] but it doesn't recognize the \[code\]Page\[/code\] element.
 
Back
Top