Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Extending LoginName Control !!

Extending LoginName Control !!

Scheduled Pinned Locked Moved ASP.NET
tutorial
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nadia Monalisa
    wrote on last edited by
    #1

    Hi, I want to show some more information in the LoginName control instead of just the user name. For example, i may want to show the email address or full name in LoginName control. So, I wanted to extend the control and create a new one. But, I dont understand how to retrieve the value of the login name in the code, there is no property such as 'Value'. The only property is closed to the desired one is 'FormatString', but cant understand how to get the value. Can you please give me a guideline. Regards.

    P 1 Reply Last reply
    0
    • N Nadia Monalisa

      Hi, I want to show some more information in the LoginName control instead of just the user name. For example, i may want to show the email address or full name in LoginName control. So, I wanted to extend the control and create a new one. But, I dont understand how to retrieve the value of the login name in the code, there is no property such as 'Value'. The only property is closed to the desired one is 'FormatString', but cant understand how to get the value. Can you please give me a guideline. Regards.

      P Offline
      P Offline
      Pavel Yermalovich
      wrote on last edited by
      #2

      Hello! It isn't difficult to do. You drag Login Control into your page. Click on SmartTag and then choose "Convert to Template". You should get the following html code: <asp:Login ID="Login1" runat="server"> <LayoutTemplate> <table border="0" cellpadding="1" cellspacing="0" style="border-collapse:collapse;"> <tr> <td> <table border="0" cellpadding="0"> <tr> <td align="center" colspan="2"> Log In</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> </td> <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> </td> <td> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>

      N 1 Reply Last reply
      0
      • P Pavel Yermalovich

        Hello! It isn't difficult to do. You drag Login Control into your page. Click on SmartTag and then choose "Convert to Template". You should get the following html code: <asp:Login ID="Login1" runat="server"> <LayoutTemplate> <table border="0" cellpadding="1" cellspacing="0" style="border-collapse:collapse;"> <tr> <td> <table border="0" cellpadding="0"> <tr> <td align="center" colspan="2"> Log In</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> </td> <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> </td> <td> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>

        N Offline
        N Offline
        Nadia Monalisa
        wrote on last edited by
        #3

        Thanks, actually I did not mean the Login Control, rather, I meant the LoginName control. But anyway, I have solved the problem by developing a new custom control from scratch. :) Regards,

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups