<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="C1Dialog_Sample._Default" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.48" Namespace="C1.Web.Wijmo.Controls.C1Dialog" TagPrefix="wijmo" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

    <script>

        function toggleVisible() {
            let isOpen = $("#<%=C1Dialog1.ClientID%>").c1dialog('isOpen');

            if (isOpen)
                $("#<%=C1Dialog1.ClientID%>").c1dialog('close');
            else
                $("#<%=C1Dialog1.ClientID%>").c1dialog('open');
        }

        function move(x, y) {
            //x: horizontally
            //y: vertically
            $("#<%=C1Dialog1.ClientID%>").c1dialog('option', 'position', [x, y]);
        }
    </script>

    <button type="button" onclick="toggleVisible()">toggle Visible</button>
    <button type="button" onclick="move('center', 'top')">move('center', 'top')</button>
    <button type="button" onclick="move('left', 'top')">move('left', 'top')</button>
    <button type="button" onclick="move('center', 'middle')">move('center', 'middle')</button>

    <wijmo:C1Dialog ID="C1Dialog1" runat="server" Height="200" Width="200"></wijmo:C1Dialog>

</asp:Content>
