Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 08, 2011 02:40 PM by jakenet
Sep 25, 2006 05:40 AM|LINK
Sep 25, 2006 07:17 PM|LINK
the above code given, is much complecated one.
Oct 08, 2006 02:44 AM|LINK
For those who are using the .Net 2.0 login control, I just thought about a hacky way to implement the scenario where users can hit the Enter key to fire the login button event, here is how it works:
1- wrap your login control into a Panel and call it Panel1.
2- inset a button on stage and call it dummyButton, set it's width and height to 0, set it border to none and it is background anad foreground to white set it is text to empty string.( this is way, dummybutton will be invisible). If you are wondering why
wouldn't I just set the visibility to false, well the answer is that it won't work.
3- set the defaultbutton of Panel1 to dummyButton and set put this code the dummyButton your click handler
bool crediteUser =
Hope this helps
Oct 10, 2006 01:25 AM|LINK
Oct 10, 2006 05:30 AM|LINK
Oct 10, 2006 05:31 AM|LINK
Oct 10, 2006 07:19 AM|LINK
Oct 10, 2006 12:10 PM|LINK
Oct 11, 2006 12:14 PM|LINK
After much seraching, I found a workable solution to this problem. Basically we need to manually set up the same client code that would be injected if we were using a Default button for a panel.
Assume we have a <asp:Login ... /> control on a page named "Login1"
In the Page_Load event handler:
Control ctl = Login1.FindControl("LoginButton");
if(ctl != null && ctl
Not sure why you guys are still having problems after this post. I'm using .Net 2.0 Login controls and this worked great for me. I'm using VB thought I coudln't translate the If Then check to see if it's a button and null, but the rest of it worked great.
What's the reason for all this Panel1 and invisible buttons for?
My Code Behind, just like the post:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ctl As Control = userLogin.FindControl("LoginButton")
My ASPX Page:
<asp:Login ID="userLogin" runat="server" LoginButtonImageUrl="~/images/buttons/log_in.gif"
LoginButtonType="Image" PasswordRecoveryText="Forgot Password?" PasswordRecoveryUrl="/ForgotPassword.aspx"
TitleText="User Login" UserNameLabelText="User ID:" >
<TitleTextStyle Font-Bold="True" Font-Size="Medium" ForeColor="SteelBlue" />
<TextBoxStyle Width="135px" />
<LabelStyle Font-Bold="True" />
Oct 30, 2006 08:36 PM|LINK
I added a generic help button to my master page and the enter key started firing the help button instead of the login
button. Your solution is just what I needed!