I am using Asp.Net/C#.I am using Asp.Net's built-in Membership Framework.I have a requirement wherein the current(logged-in) user’s name should be displayed in the horizontal menu towards the right side.The aspnet_Users table stores the UserName in the form of some code like ppp001 where as the actual name of the user For Example: John Smith is stored in the table which is linked to aspnet_Users table using a Foreign Key constraint.So my question is how do I display the users name from that table to my menu.Should I use repeater control.
Any suggestions are welcome.
Thanks
The simplest way to do it is to store the first name and last name in the profile provider and then use a label or div which has runat=”sever”
in the web.config
then set your div or label
The disadvantage with using the profile provider is that all the profile properties get concatenated into a big string so it’s hard to query against that. The better way to do this is to create your own BasePage class which makes a call to the database to retrieve the first name and last name from a specific table, using the foreign key like you mentioned. I usually set this to a MyLoggedInUser property of the page. That way all your pages can get to it via this.Page.MyLoggedInUser.FirstName, etc..