sbornstein2
asked on
Submit button not firing on enter key press help..
Hello all this is a little tricky. I have an ASPX page that loads a control within it. The ASPX page holds the focus on a certain link button. In the ASCX control I am using a CreateUserWizard and in that you set the button text etc like so:
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" ContinueDestinationPageUrl ="~/BookWo rk/Protect ed/AuthorC ontrolPane l.aspx?Fir stLogin=tr ue"
DisableCreatedUser="false" Font-Names="Verdana" BackColor="white" CompleteSuccessText="The account has been successfully created. Click the continue button to begin or wait and you will be automatically redirected to your Author Control Panel in 5 seconds."
UnknownErrorMessage="The account was not created. Please try again." OnCreatedUser="CreateUserW izard1_Cre atedUser"
CreateUserButtonText="Crea te New Account!" ContinueButtonStyle-CssCla ss="Create UserContin ueButton">
whats happening is everytime I hit submit its going to the main ASPX page button. I tried surrounding the ascx into a panel and form but no luck. Also I cant use defaultbutton because it does not have an id. I have textboxes in the wizard area and then the button just creates at the bottom of it. Any idea how I can on enter of any textbox make sure it hits this button it creates?
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" ContinueDestinationPageUrl
DisableCreatedUser="false"
UnknownErrorMessage="The account was not created. Please try again." OnCreatedUser="CreateUserW
CreateUserButtonText="Crea
whats happening is everytime I hit submit its going to the main ASPX page button. I tried surrounding the ascx into a panel and form but no luck. Also I cant use defaultbutton because it does not have an id. I have textboxes in the wizard area and then the button just creates at the bottom of it. Any idea how I can on enter of any textbox make sure it hits this button it creates?
ASKER
the issue is I dont have a ID for this button its used in the CreateUserWizard as you can see above. How can I reference this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is a common issue, I like to add the function call as an attribute to the control when the page is loaded, of course this all depends on the context.
There is a lot of information and code samples out there on this subject.
Hope this helps, Sean
http://aspnet.4guysfromrolla.com/articles/060805-1.aspx
http://www.allasp.net/enterkey.aspx
http://www.beansoftware.com/ASP.NET-Tutorials/Accept-Enter-Key.aspx