private void InitCollector(Boolean isEditing) { Collector = new CollectorControl(); CallbackHandler handler = new CallbackHandler("ThemeConfigurationCallbackHandler"); handler.OnCallback += handler_OnCallback; var popup = new HTMLText(String.Format(@" <div class=""modal fade"" id=""popupThemeLoader""> <div class=""modal-dialog modal-lg""> <div class=""modal-content""> <div class=""modal-header""> <button type=""button"" class=""close"" data-dismiss=""modal"" aria-label=""Close""><span aria-hidden=""true"">×</span></button> <h4 class=""modal-title"">Theme CSS uploading</h4> </div> <div class=""modal-body""> <div class=""form-group""> <label for=""themeName"">Theme name</label> <input name=""themeName"" type=""text"" class=""form-control"" id=""themeName"" placeholder=""Name of destination theme folder""> </div> <div class=""form-group""> <label for=""bootstrapCSS"">Bootstrap CSS</label> <textarea name=""bootstrapCSS"" class=""form-control"" rows=""20"" id=""bootstrapCSS"" placeholder=""Main Bootstrap CSS content""></textarea> </div> </div> <div class=""modal-footer""> <button type=""button"" class=""btn btn-default pull-right"" data-dismiss=""modal"">Cancel</button> <button type=""button"" class=""btn btn-default pull-right"" data-dismiss=""modal"" onclick="" startProgress(); setTimeout(function() {{ {0} }}, 1000);"">OK</button> </div> </div> </div> </div> ", handler.GetScript("'save'"))); var popupButton = new HTMLText(@"<button class=""btn btn-default btn-sm"" type=""button"" onclick=""$('#popupThemeLoader').modal();""><span class=""glyphicon glyphicon-upload""></span> Upload</button>"); Collector.Controls.Add(Edit); if (isEditing) { Collector.Controls.Add(popup); Collector.Controls.Add(popupButton); } }