+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Login Name Control

Login Name Control

7 posts, 1 answered
  1. Mike Davis
    Mike Davis avatar
    5 posts
    Registered:
    25 May 2010
    25 May 2010
    Link to this post
    Sitefinity 3.7

    I've inserted a login name control on a page but it displays the username, not the user's first name and last name.  Although I've edited some other control templates, I can't find the login name template. 

    How can I cause the login name control to bring back the user's first name and last name?

    Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    25 May 2010
    Link to this post
    Hi Mike Davis,

    The LoginName  is ASP.NET control - System.Web.UI.WebControls.LoginName. The control uses an internal class LoginUtil which calls GetUserName method which returns string name from the IPrincipal

    To get the first and last name, you should better create a simple user control which gets FirstName and LastName profile data.

    ProfileBase profile = ProfileBase.Create(UserManager.GetCurrentUserName());
    var fn = (string)profile.GetPropertyValue("FirstName");
    var ln  = (string)profile.GetPropertyValue("LastName");
    Response.Write(fn + ln);


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
  3. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    24 Mar 2011
    Link to this post
    Hi,

    I am trying to change the 'Login name' font to Italic=True.
    It seems to remember the the setting but the text is not
    displayed as Italic.

    Also, 'Login Status' font size was not working properly.
    Maybe its just me. I am using build 1238.

    Thanks,
    Andrei
  4. Petya
    Petya avatar
    123 posts
    Registered:
    17 Oct 2016
    24 Mar 2011
    Link to this post
    Hi Andrei,

    Thank you for contacting us. I am logging the problem with the "Login name" widget as a bug.  I updated your Telerik points.
     
    Unfortunately, I'm not able to reproduce the other problem with the "Login status". Did you add any settings to this widget except for the font size? Maybe you can send some screenshots or exact steps to reproduce this problem. Any additional information would be helpful. Thanks in advance!

    Kind regards,
    Petya
    the Telerik team
  5. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    24 Mar 2011
    Link to this post
    Petya,

    The limit on this forum is 2MB so please get the .swf file from the link below:
    https://www.transferbigfiles.com/97a25057-a8cc-4b22-891a-31c8d9389222?rid=mDkegWm2IxSfyDvHScohEA%3d%3d

    To answer your question: Yes, there is a CSS control linked to it.

    It works fine when you add a font-size, but not when you want to take it away again.

    Many thanks,
    Andrei
  6. Petya
    Petya avatar
    123 posts
    Registered:
    17 Oct 2016
    30 Mar 2011
    Link to this post
    Hello Andrei,

    I'm not able to download the file you sent me. I'm receiving this message "This transfer has expired and the files are no longer available for download". I tried again to reproduce the problem, but it was working fine for me. Can you try it with another "Login status" control on another page not using any CSS?

    Kind regards,
    Petya
    the Telerik team
  7. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    05 Apr 2011
    Link to this post
    Petya,

    Yes, the file has an expiry date. I don't have time to double-check this issue,
    but will return to it if it resurfaces.

    Many thanks again,
    Andrei
Register for webinar
7 posts, 1 answered