public override string GetDesignTimeHtml()
        {
            try
            {
                string output = string.Empty;

                SubmitDialog dialog = (SubmitDialog)this.Component;

                if (dialog != null)
                {
                    dialog.ShowDialog(Submit.Type.Job, 5);
                }

                StringWriter   writer = new StringWriter();
                HtmlTextWriter html   = new HtmlTextWriter(writer);
                dialog.RenderBeginTag(html);
                html.Write(DesignHTML);
                dialog.RenderEndTag(html);
                output = writer.ToString();

                return(output);
            }
            catch (Exception ex)
            {
                return(ex.ToString());
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles the Load event
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            //Server.Disconnect();
            //Server.Connect();

            m_UpdatePanel = new UpdatePanel
            {
                ID = GetChildControlID("UpdatePanel")
            };
            m_UpdatePanel.ChildrenAsTriggers = true;
            m_UpdatePanel.RenderMode         = UpdatePanelRenderMode.Block;

            m_SubmitTree = new SubmitTree
            {
                ID = GetChildControlID("SubmitTree")
            };
            m_SubmitTree.SubmitMenu = this;

            m_SubmitDialog = new SubmitDialog
            {
                ID           = GetChildControlID("SubmitDialog"),
                DisplayModal = true,
                ServerName   = m_ServerName
            };

            //
            //  Create the dialog that is displayed in the m_ResultPopup when
            //  a job has been submitted
            //
            m_ResultDialog = new Panel
            {
                ID = GetChildControlID("Submit_ResultDialog")
            };

            Panel labelPanel = new Panel();

            m_ResultLabel = new Label();
            m_ResultLabel.Style["width"]  = "auto";
            m_ResultLabel.Style["margin"] = "4%";
            labelPanel.Controls.Add(m_ResultLabel);
            labelPanel.Style["background-color"] = "#FFFFFF";
            labelPanel.Style["height"]           = "50px";
            labelPanel.HorizontalAlign           = HorizontalAlign.Left;
            m_ResultDialog.Controls.Add(labelPanel);

            Button okButton = new Button
            {
                Text = "OK",
                ID   = GetChildControlID("Submit_ResultOkButton")
            };

            okButton.Style["margin"]       = "2%";
            m_ResultDialog.HorizontalAlign = HorizontalAlign.Right;
            m_ResultDialog.Controls.Add(okButton);
            m_ResultDialog.Style["display"] = "None";
            m_ResultDialog.Style["Height"]  = "100px";
            m_ResultDialog.CssClass         = "modalPopup";

            m_ResultPopup = new ModalPopupExtender
            {
                ID = GetChildControlID("ResultExtender")
            };
            m_ResultPopup.PopupControlID     = m_ResultDialog.ID;
            m_ResultPopup.TargetControlID    = GetChildControlID("ResultDummyButton");
            m_ResultPopup.OkControlID        = okButton.ID;
            m_ResultPopup.BackgroundCssClass = "modalBackground";
            m_ResultPopup.Controls.Add(m_ResultDialog);

            Button button2 = new Button();

            button2.ID = GetChildControlID("ResultDummyButton");
            button2.Style["display"] = "none";
            button2.Height           = 0;
            button2.Width            = 0;

            Control controlContainer = m_UpdatePanel.ContentTemplateContainer;

            controlContainer.Controls.Add(this.m_SubmitTree);
            controlContainer.Controls.Add(this.m_SubmitDialog);
            controlContainer.Controls.Add(m_ResultPopup);
            controlContainer.Controls.Add(m_ResultDialog);
            controlContainer.Controls.Add(button2);

            base.Controls.Add(m_UpdatePanel);
        }