CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 9/13/2006 9:41:38 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 61 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
ethebaud
Asp.Net User
Master Page User.Identity.Name problem9/13/2006 9:41:38 PM

0/0

Hello I've written some code to check information based on the authenticated user. The following code works on an ASPX page load but fails when I move into a Master Page. Specifically, the error is "Compiler Error Message: BC30451: Name 'User' is not declared."  

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

' Get & split Domain user Information

Dim strDomainUser As String = User.Identity.Name

....

 Any help would be appreciated.

Thanks,

Ed

lostlander
Asp.Net User
Re: Master Page User.Identity.Name problem9/14/2006 1:19:19 AM

0/0

Try:

HttpContext.Current.User.identity.name

Or

Page.User.Identity.Name

Hope it helps!^_^

mokeefe
Asp.Net User
Re: Master Page User.Identity.Name problem9/14/2006 1:33:42 AM

0/0

Or

Dim strDomainUser As String = Context.User.Identity.Name

Context object is available in earlier dotnet releases also.

If Context.User.Identity.IsAuthenticated Then

   Response.Write("Current user:" & Context.User.Identity.Name)

Else

   Response.Write("Unauthenticated request.")

End If

 


Rgds,
Martin.

For the benefit of all users please mark any post answers as appropriate.
ethebaud
Asp.Net User
Re: Master Page User.Identity.Name problem9/18/2006 10:07:23 PM

0/0

Much thanks. Both suggestions worked.

 Ed

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Pro Visual Studio 2005 Team System Application Development: Application Design Authors: Steve Shrimpton, Pages: 768, Published: 2006
ASP.NET 2.0 Everyday Apps For Dummies Authors: Doug Lowe, Pages: 504, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
ASP.NET 2.0 Web Parts in Action: Building Dynamic Web Portals Authors: Darren Neimke, Pages: 324, Published: 2007
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008
Expert VB 2005 Business Objects Authors: Rockford Lhotka, Pages: 670, Published: 2006

Web:
Master Page User.Identity.Name problem - ASP.NET Forums Re: Master Page User.Identity.Name problem. 09-13-2006, 9:19 PM. Contact ... Re: Master Page User.Identity.Name problem. 09-13-2006, 9:33 PM ...
user.identity.name doesn't work on server - ASP.NET Forums Identity.Name.. but still it is giving me same problem. .... User.Identity.Name concept in my master page. so to keep that two things on ...
User.Identity.Name not working in master page codebehind : master ... Text = User.Identity.Name It works. But if I try to use the User.Identify.Name in the codebehind of a master page (Page_Load),...
[2008] User.Identity.Name In MasterPage - VBForums i have a masterPage in my web-application and in that master page and i need to user "User.Identity.name" in that masterpage. the problem is ...
Cant we access "User.Identity,Name" element in Master Page ? - ASP ... Filed under: master page, user.identity, master page-User name display ... About this Site. Questions / Problems with this site? ...
user online using User.Identity.Name - ng.asp-net-forum.security ... authenticaion and session var problem - User.Identity.Name empty . ... Cant we access "User.Identity,Name" element in Master Page ? - ASP ... User.Identity. ...
Page.User.Identity.Name User.Identity.Name. microsoft.public.dotnet.framework.aspnet. Author. 19 May 2006 9:53 AM .... Postback,Master page,User control problem ...
Creating a Custom Membership Provider and Membership User ... the Master Page PreInit Fires before the PageLoad each page Dim myUser As ShiningStar. ... GetUser(Page.User.Identity.Name, IsLoggedIn) ' uses adapter ...
User.Identity.Name (VB.net) : Authentication « Development « ASP.Net User Control and Master Page. 15. Validation by Control ... Message.Text &= " User Name: " & User.Identity.Name End Sub ...
How To? Programmatically Set Theme For Master Page programmatically set a theme for a master page? ... By default, ASP.NET uses the Page.User.Identity.Name // within the current HttpContext ...

Videos:
A New Way to look at Networking Google Tech Talks August 30, 2006 Van Jacobson is a Research Fellow at PARC. Prior to that he was Chief Scientist and co-founder of Packet Design. P...




Search This Site:










foreign keys in my security application

what's new in vs2005

connecting and logining onto a remote site

drag drop feature in asp.net treeview

arrrrghhh what do i need to do to be able to get the host tabs?

performance and memory issues with beta 2

date format

photo module for registered user postings?

cr/lf issues

reporting

plz help!

creating dll files.

accessing starter kit templates from visual studio 2005

clear all checked nodes under treeview

msaccess data provider

set variable to template page

does visual web developer express work with ms sql server 2005 developer?

load parts of a xml tree

best blogs on web

new dnn 2.1.2 tourism site

warning: the dependency 'dotnetnuke'...

simple search

is it possible adding our own keywords to intellisense ?

strongly typed dataset question

how do you test pwsk under iis ??? **** need some help ****

include

searching and retrieve an external site from asp.

submit button click event

problem with "log out"

detecting null value returned from sqlcommand storedprocedure

 
All Times Are GMT