protected override void CreateChildControls() { base.CreateChildControls(); // Make sure we use block mode instead of stock inline-block this.Style.Add(HtmlTextWriterStyle.Display, "block"); this.Style.Add(HtmlTextWriterStyle.Margin, "10px"); this.Controls.Add(new LiteralControl(string.Format("<b>{0}</b><hr/>", Resources.LocalizationOptions))); Image img = new Image(); if (this.Page != null) { img.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), GlobalizationResources.INFO_ICON_EDITRESOURCES); } img.Style[HtmlTextWriterStyle.MarginRight] = "10px"; this.Controls.Add(img); // Add an Ajax Callback control to handle inline display AjaxMethodCallback callback = new AjaxMethodCallback(); callback.PageProcessingMode = CallbackProcessingModes.PageLoad; callback.TargetInstance = this; callback.ID = "_resourceCallback"; callback.ClientProxyTargetType = this.GetType(); callback.GenerateClientProxyClass = ProxyClassGenerationModes.Inline; this.Controls.Add(callback); LinkButton button = this.btnEditResources; button.ID = "btnEditResources"; button.Text = Resources.EditPageResources; //but.Attributes.Add("target", "LocalizationForm"); button.Click += new EventHandler(OnEditResources); this.Controls.Add(button); this.Controls.Add(new LiteralControl("<br/>")); CheckBox cb = this.chkShowIcons; cb.ID = "chkShowIcons"; cb.Text = Resources.ShowLocalizationIcons; cb.AutoPostBack = true; cb.Checked = this.ShowIcons; cb.CheckedChanged += new EventHandler(this.OnShowIcons); this.Controls.Add(cb); }
protected override void CreateChildControls() { base.CreateChildControls(); // Make sure we use block mode instead of stock inline-block this.Style.Add(HtmlTextWriterStyle.Display, "block"); this.Style.Add(HtmlTextWriterStyle.Margin, "10px"); this.Controls.Add(new LiteralControl(string.Format("<b>{0}</b><hr/>", Resources.LocalizationOptions))); Image img = new Image(); if (this.Page != null) img.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), GlobalizationResources.INFO_ICON_EDITRESOURCES); img.Style[HtmlTextWriterStyle.MarginRight] = "10px"; this.Controls.Add(img); // Add an Ajax Callback control to handle inline display AjaxMethodCallback callback = new AjaxMethodCallback(); callback.PageProcessingMode = CallbackProcessingModes.PageLoad; callback.TargetInstance = this; callback.ID = "_resourceCallback"; callback.ClientProxyTargetType = this.GetType(); callback.GenerateClientProxyClass = ProxyClassGenerationModes.Inline; this.Controls.Add(callback); this.Controls.Add(new LiteralControl("<br/>")); CheckBox cb = this.chkShowIcons; cb.ID = "chkShowIcons"; cb.Text = Resources.ShowLocalizationIcons; cb.AutoPostBack = true; cb.Checked = this.ShowIcons; cb.Attributes.Add("onclick","if(ww.resourceEditor.isResourceEditingEnabled ? : )") //cb.CheckedChanged += new EventHandler(this.OnShowIcons); this.Controls.Add(cb); }