ComponentOne Extender Controls for ASP.NET Web Forms
Wijmo Control Toolkit Extender Controls / C1DialogExtender / Using the Modal Dialog Window Options / Using the Confirm Dialog Option
In This Topic
    Using the Confirm Dialog Option
    In This Topic

    The C1DialogExtender control allows you to create Confirm windows to confirm events like file deletion or emptying the recycle bin.

    To create a Confirm dialog window, complete the following:

    1. Create an ASP.NET Web application.
    2. Add a standard Panel control to the main content of your page.
    3. Insert the following markup within the Panel markup to create the dialog window:

    <div>

            <input type="button" value="Show Confirm" onclick="$('#dialog-confirm').wijdialog('open')" />

            <div id="dialog-confirm" title="Empty recycle bin?">

                <p>

                    <span class="ui-icon ui-icon-alert"></span>These items will be permanently deleted

                    and cannot be recovered. Are you sure?</p>

            </div>

        </div>

    1. Click the Panel smart tag and select Add Extender from the Tasks menu.
    2. In the Extender Wizard, select C1DialogExtender and click OK. A C1DialogExtender control is added to the page and the TargetControlID is set to Panel1.
    3. Select View | Properties Window in the Visual Studio menu.
    4. Click the drop-down list at the top of the Properties window and select Panel1_C1DialogExtender.
    5. Set the C1DialogExtender.Modal property to True.
    6. Add the following markup within the <cc1:C1DialogExtender> tags to create a Delete and Cancel button in the dialog window, so the markup looks like the following:

    <cc1:C1DialogExtender ID="Panel1_C1DialogExtender" runat="server"

            CloseOnEscape="False" Show="blind" TargetControlID="Panel1" Modal="True">

             <ExpandingAnimation Duration="400">

            </ExpandingAnimation>

            <Buttons>

                <cc1:DialogButton OnClientClick="delClick" Text="Delete" />

                <cc1:DialogButton OnClientClick="cancelClick" Text="Cancel" />

            </Buttons>

            <CaptionButtons>

                <Pin Visible="false" />

                <Refresh Visible="False" />

                <Toggle Visible="False" />

                <Minimize Visible="False" />

                <Maximize Visible="False" />

            </CaptionButtons>

            <CollapsingAnimation Duration="300" />

        </cc1:C1DialogExtender>

    1. Insert the following script within the <asp:Content> tags to close the dialog window when either of the buttons is clicked:

    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

      <script type="text/javascript">

          function delClick() {

              $(this).wijdialog("close");

          }

          function cancelClick() {

              $(this).wijdialog("close");

          }

        </script>

    </asp:Content>

    1. Run your application to see the Confirm Window. It should resemble the following image: