Пример #1
0
        private static void WriteProgressBar(TextWriter writer)
        {
            HtmlGenericControl container = new HtmlGenericControl("div");

            container.ID = "progressArea";

            HtmlGenericControl progressContainer = new HtmlGenericControl("div");

            container.Controls.Add(progressContainer);

            progressContainer.ID              = "progressContainer";
            progressContainer.Style["width"]  = "100%";
            progressContainer.Style["height"] = "20px";
            progressContainer.Style["border"] = "1px solid silver";

            HtmlGenericControl progressBar = new HtmlGenericControl("div");

            progressContainer.Controls.Add(progressBar);

            progressBar.ID = "progressBar";
            progressBar.Style["text-align"]       = "left";
            progressBar.Style["width"]            = "0%";
            progressBar.Style["height"]           = "20px";
            progressBar.Style["background-color"] = "blue";

            HtmlGenericControl statusText = new HtmlGenericControl("div");

            container.Controls.Add(statusText);

            statusText.ID = "statusText";
            statusText.Style["text-align"]    = "left";
            statusText.Style["padding-left"]  = "8px";
            statusText.Style["padding-right"] = "8px";

            writer.Write(container.GetHtml());
        }