Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This Is My Code And I Want to set Login As Default Button when Press Enter Key
C#
<td>                
  <div>
   <asp:LoginView ID="lgnView" runat="server">
    <anonymoustemplate>
      <asp:Login ID="lgnUser"  OnAuthenticate="lgnUser_Authenticate" runat="server" Height="122px" Width="308px">
       <textboxstyle font-size="0.8em" />
       <loginbuttonstyle backcolor="#FFFBFF" bordercolor="#CCCCCC" borderstyle="Solid" borderwidth="1px" font-names="Verdana" font-size="0.8em" forecolor="#284775" />
        <instructiontextstyle font-italic="True" forecolor="Black" />
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
     
    </anonymoustemplate>
<contenttemplate>
                                       
</contenttemplate>
  </div>
</td>
Posted
Updated 1-Sep-16 21:12pm
v3

 
Share this answer
 
There is a defaultbutton property in form tag of aspx page in which you can set your login control id like defaultbutton="lgnUser"
 
Share this answer
 
Comments
Swinky_Talwar 25-Sep-13 6:39am    
Showing This error The DefaultButton of '' must be the ID of a control of type IButtonControl.
C#
If you move the panel inside the login's template:-

 <asp:login id="Login2" runat="server" loginbuttontype="Image">
    <layouttemplate>
            <asp:panel id="Panel1" runat="server" defaultbutton="LoginImageButton">

 
Then it will work without code.
You can set loginbuttontype="Image" by Image,Link or button.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900