Welcome Guest Search | Active Topics | Sign In | Register

dialog is closing prematurely Options
Joan Darling
Posted: Monday, January 16, 2012 11:40:04 AM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
I have a dialog that has a table, a textbox and two buttons in the content template. one of the buttons is set as the accept and close button event for the dialog and the other button calls a function to validate the input. There are no triggers on the call back pannel, the execute is fired manually. When The user clicks the Add button it validates the value and alerts them to any problems. If there was a problem, after the alert is acknowledged the validateInput function sets focus to the txtInput control.

I expected the dialog to remain open so the user can correct any problems in the input but the dialog closes. The call back panel execute is not called and the dialogs close method is not called. Any ideas what I'm doing wrong?

Code: HTML/ASPX
<ContentTemplate>
    <eo:CallbackPanel ID="CallbackPanel1" runat="server">
        <asp:TextBox ID="txtInput" runat="server"></asp:TextBox>
        <asp:Button ID="btnValidate" runat="server" Text="Add" onclientclick="validateInput(this)"/>
        <asp:Button ID="btnClose" runat="server" Text="Close"/>
        <table>
             .
             . (some rows)
             .
        </table>
    </eo:CallbackPanel>
</ContentTemplate>
eo_support
Posted: Monday, January 16, 2012 1:33:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Your button is an asp:Button control. An asp:Button control posts back the page when it's clicked. When a page is posted back, the whole page is destroyed and reloaded. This also means the dialog is destroyed as well --- which causes the dialog to close.

Thanks!
Joan Darling
Posted: Monday, January 16, 2012 4:26:00 PM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
Thanks, that did it.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.