Link to home
Start Free TrialLog in
Avatar of sbornstein2
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="~/BookWork/Protected/AuthorControlPanel.aspx?FirstLogin=true"
    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="CreateUserWizard1_CreatedUser"
    CreateUserButtonText="Create New Account!" ContinueButtonStyle-CssClass="CreateUserContinueButton">

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?
Avatar of bullrout
bullrout

Hi There,

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
Avatar of sbornstein2

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
Avatar of bullrout
bullrout

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial