Пример #1
0
        protected override void Render(HtmlTextWriter writer)
        {
            controlToRender = JavascriptPage.CreateDiv(this.ID);

            foreach (MenuItem item in this.menuItems)
            {
            }
        }
Пример #2
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            controlToRender.TagName = "div";
            controlToRender.Attributes.CssStyle.Add("display", "none");

            if (!string.IsNullOrEmpty(BoxCssClass))
            {
                controlToRender.Attributes.Add("class", BoxCssClass);
            }
            else
            {
                controlToRender.Style.Add("width", "450px");
                controlToRender.Style.Add("height", "250px");
                controlToRender.Style.Add("background-color", "#FFFFFF");
                controlToRender.Style.Add("border", "1px solid #000000");
            }

            controlToRender.ID = boxId;

            HtmlGenericControl title = new HtmlGenericControl("div");

            title.ID        = titleId;
            title.InnerHtml = Title;
            if (!string.IsNullOrEmpty(TitleCssClass))
            {
                title.Attributes.Add("class", TitleCssClass);
            }
            else
            {
                title.Style.Add("background-color", "#0000FF");
                title.Style.Add("border", "1px solid #000000");
                title.Style.Add("margin", "1px");
                title.Style.Add("padding", "3px");
            }



            controlToRender.Controls.Add(title);

            HtmlGenericControl messageText = JavascriptPage.CreateDiv(messageId);

            if (!string.IsNullOrEmpty(this.MessageCssClass))
            {
                messageText.Attributes.Add("class", MessageCssClass);
            }
            else
            {
                messageText.Style.Add("height", "175px");
            }

            controlToRender.Controls.Add(messageText);

            JsonFunction registration = new JsonFunction();

            registration.ExecutionType = JavascriptExecutionTypes.OnWindowLoad;
            string body = "\r\nif(MessageBox != 'undefined'){";

            body += string.Format("\tMessageBox.RegisterMessageBox('{0}','{1}','{2}');", boxId, titleId, messageId);
            body += "}";
            registration.FunctionBody = body;

            controlToRender.RenderControl(writer);
            registration.RenderControl(writer);

            //    <div id="messageDiv" style="display: none; border:1px solid black; background-color: White; width: 400px;" class="modal">
            //        <div id="messageDrag" style="background-color: #FFCC99; padding: 3px; border:1px solid black; "><b>Patterns Setup Message</b></div>
            //        <div id="messageText"></div><br /><br />
            //    </div>
        }