Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Submit button not firing on enter key press help..

Posted on 2007-10-11
3
Medium Priority
?
1,371 Views
Last Modified: 2008-01-09
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?
0
Comment
Question by:sbornstein2
  • 2
3 Comments
 
LVL 5

Expert Comment

by:bullrout
ID: 20064488
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
0
 

Author Comment

by:sbornstein2
ID: 20065511
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?
0
 
LVL 5

Accepted Solution

by:
bullrout earned 2000 total points
ID: 20069563
sorry, you can do this:

 open the controls's Smart Task pane, and then choose Convert to CustomNavigationTemplate.

You should then see something like this:

 <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser">
            <WizardSteps>
                <asp:CreateUserWizardStep runat="server">
                    <CustomNavigationTemplate>
                        <table border="0" cellspacing="5" style="width: 100%; height: 100%;">
                            <tr align="right">
                                <td align="right" colspan="0">
                                    <asp:Button ID="StepNextButton" runat="server" BackColor="Green" CommandName="MoveNext"
                                        Text="Create User" ValidationGroup="CreateUserWizard1" />
                                </td>
                            </tr>
                        </table>
                    </CustomNavigationTemplate>

                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep runat="server">
                </asp:CompleteWizardStep>
               
            </WizardSteps>
            <ContinueButtonStyle BackColor="#804000" />
            <CreateUserButtonStyle BackColor="Green" />
        </asp:CreateUserWizard>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question