Getting the user's first and last name

I'm using the login control and I'm getting the username without a problem (<asp:LoginName ID="LoginName1" runat="server" />) but how do I get the user's first and last name (or any other information)?  I do have the user's information stored in a database.  I'm not utilizing Profile schema either.


2/13/2009 8:52:38 PM 13714 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 2

Use the MemberShip class to get the user information.

*** If this post helps you, then Mark this post as Answer ***
2/13/2009 9:02:16 PM

Similar Artilces:

How to get domain user's first name, last name and e-mail address
Hi everyone, I am able to retrieve the domain/user ID by setting <authentication mode="Windows"/> in the Web.config file, and with the following code in my Default.aspx.,cs page: string strName = Request.ServerVariables["AUTH_USER"]; I would also like to retrieve the users first name, last name and e-mail address from their domain profile, if possible.  Can anyone help me with a code example?  I'm somewhat new to C#/.NET/OOP so if you have it in "C# for Dummies" format, I would be very thankful! Thanks in advance for any help that i...

Getting user's first and last name from AD
I have an intranet site running with windows authentication, and I would like to greet the user with their full name. What's the best way to find the first and last name values entered in the AD database?I guess it needs a DirectorySearcher object, but my AD knowledge stops there.Thanks,JohnJohn Inflatable Boats You can get the current user's details by parsing their domain name and performing a search for it.  Here is an example - 'sn' and 'givenName' are last name and first name respectively.<%@ Assembly Name="System.DirectoryServices, Version=1.0.5000.0, Cultur...

Get user's first and last name from Active directory.
Hi,I'm trying to get user's first and last name from AD to display in my welcome page. I'm using Visual Studio 2005. In my login page I have login control and I'm using forms authentication against LDAP.So I don't have to store user data. Any help would be greatly appreciated.   DirectoryEntry objOU = new DirectoryEntry(",%20DC=domain,%20DC=something,%20DC=net%20or%20com>/">LDAP://CN=your user name, OU=users group>, DC=domain, DC=something, DC=net or com"); string name = objOU.Properties["givenName"].Value.ToString(); string...

Unable to access user control's user control's function\property from another user control
Hi, I used to call an user control's user control function as stated below from my user control in ASP.Net 1.1 wucCompany.wucEmployee.GetEmployeeSomething() After migrating to ASP.Net 2.0, I am unable to use any properties/functions(even the public ones) of the user control's User control's from another user control.  The way I have to do is create property\function in wucCompany which calls the wucEmployee's property\function and call the wucDepartment.GetEmployeeSomething().Since I need to do this change in too many places, I can...

User's first and last name
What would be the simplest way to add the user's first and last name to the registration process?I noticed there was a comment column in membership user.  Would it be easy to add xml document to this field?Thanks!Rob you can check the link below:Extend the MembershipUser class

how to get a control ID from a bind field name / bound field (column) name from a formview's control
I have a form view which is bound to a table, now from codebehind file I need to apply some formatting based on some of the field's bound control. For example, if Formview1 is bound to Employee table, and it's item template has a control with ID "Label1" which is bound to "EmployeeJoinDate" . Now, I have a different table which has a list of field name(EmployeeJoinDate is one of them), all of which should be applied some formatting based on some condition. Now I can take two approach for that, but I am stuck at both:  1. If I can somehow get the contro...

Getting User Control's Control Data
I am building a wizard that will pull opt reports.  Page 1 let's you pick a website you want to work with based on listings in a table.  Page 2 displays which options you can include in your opt report by bit fields in the same table that fills the dropdown on Page1.  Based on which fields get  a 1, user controls are loaded to display the options.  My question is this: How can I get the information on the options the user selects from the individual user controls? I've read up on serialization but I don't know how to capture an event that fires when a page submits a...

Getting first name and last name from Windows logged in user
 I'm sure there must be an easy way of getting the actual first name and last name from an Windows domain\username via the Windows Identity or Principal object, but I can't seem to figure it out. Does anyone have any examples of this? try this: HttpContext.Current.User.Identity.Name  Thanks - tried returns nothing or domain\loginName :( Please check that on the site properties window (in IIS Admin console), in the security tab, click on the modify or edit button in the authentication and anonymous access group and make sure only the "Windows Inte...

Why can't I get a User's Name?
Hi, I'm having real issues just getting the username of any user. To try to simplify it, I made my code like this and it still won't get anything. Can anyone help? <%@ Page Language="VB" %> <script runat="server"> sub page_load testing.text = User.Identity.Name end sub </script> <html> <head> </head> <body> <form runat="server"> <!-- Insert content here --> <asp:label id = "testing" runat="server"> </as...

Label control's text doesn't appear to be set (in the page which has a user control )when trying to update the text property in the FormView's ItemUpdated event
Hi There,I have a user control which hosts a formview control, gridview control and a label control. The grid view is usedto show rows in the DB and when clicked to edit each row, a form view opens up in edit mode with that particular row info. So I have nothing in the item template.My first question it mandatory to have smth in the itemtemplate of the form view.I have controls in edititemtemplate and insertitemtemplate.When a particular row is edited, I would like to show a status msg showing that the row has been updated.For this, I use the ItemUpdated event of the formview and try ...

Can I hide a user control's control from the hosting page's client script?
Okay, my previous question was not unswered and I guess you can't hide a control's panel with server code then show it with client code. Now this is what I try to do: on the hosting page's onload event, call a function to hide the user control's penal. Here is the deal: the user control was looped as many times as data required. So the penals will be name mypanel1, my panel2, etc... that is not even a problem if I know if the following is true: * Do all server codes finish running before the page get sent back to the client? Say the database gave me 5 penals, I can then determine how...

Open file in browser or application getting the page's name as the file's name
Hi, I'm am trying to get a file to open in either a browser or application depending on the mime type. I'am using the following code in the page load. protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack)    { DocumentInfo document = (DocumentInfo)Session["View_Document"]; StreamFile(document.Document, document.DocumentName, document.FileType.MimeType); } } }private void StreamFile(byte[] fileData, string originalFileName, string mimeType) { try { Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("Con...

User Control Within UserControl
If I have a user control A and then inside it a user control B embedded/referenced within it.  User Control A has a panel defined (cpeNewUser) that I want to manipulate from the code behind of User Control B based on some event that happens.So putting this in my code behind of User Control B won't work as it has no idea of cpeNewUser:cpeNewUser.Collapsed = true;So is it because only at runtime they are married up and because of this you cannot access each other's objects at compile time?  How would I get this to work becuase I'm using all user controls inside a AJAX Too...

LoginStatus control sees user's Windows account name and not application login name
I am upgrading a web site developed using VWDX 2005 on a machine using Windows XP.  The machine I have now is loaded with Vista and I have VWDX 2008. In the default.aspx page, the loginstatus control sees the computer user's windows account and thinks the user is logged in and as such, will only display the logout message and redirect to a logout page. I have added a login status control to display the login name<asp:LoginName id="LoginName2" runat="server" FormatString ="Welcome, {0}" /> The result shows the computer name/login name If I g...

Web resources about - Getting the user's first and last name -

Resources last updated: 12/3/2015 9:33:21 PM