Note that there are some explanatory texts on larger screens.

plurals
  1. POExtending ASP.NET Panel
    primarykey
    data
    text
    <p>I am trying to create a new Service Control extending the ASP.NET panel.</p> <p>Howwever whenever I use my panel, the divs etc render correctly. But the input in the box is only : [title] </p> <p>ie: if i do:</p> <pre><code>&lt;cc1:RoundedCornerBox id="MyBox" BoxWidth="100" BoxHeight="200"&gt; This is the content that should be displayeed &lt;/cc1:RoundedBox&gt; </code></pre> <p>all that is displayed is: [MyBox]</p> <p>(in a box that is correct)</p> <p>This is my code:</p> <pre><code>[DefaultProperty("Text")] [ToolboxData("&lt;{0}:RoundedCornerBox runat=server&gt;&lt;/{0}:RoundedCornerBox&gt;")] public class RoundedCornerBox : System.Web.UI.WebControls.Panel { public int BoxWidth { get; set; } public int BoxHeight { get; set; } [Bindable(true)] [Category("Appearance")] [DefaultValue("")] [Localizable(true)] public string Text { get { String s = (String)ViewState["Text"]; return ((s == null) ? "[" + this.ID + "]" : s); } set { ViewState["Text"] = value; } } protected override void Render(HtmlTextWriter writer) { base.Render(writer); } protected override void RenderContents(HtmlTextWriter output) { output.Write(Text); } public override void RenderBeginTag(HtmlTextWriter writer) { base.RenderBeginTag(writer); writer.Write("&lt;div class=\"roundedcornr_lt\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"roundedcornr_top\" style=\"width:" + BoxWidth.ToString() + "px\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"roundedcornr_rt\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"clear\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"roundedcornr_lside\" style=\"height:" + BoxHeight.ToString() + "px\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div style=\"width:" + BoxWidth.ToString() + "px; height:" + BoxHeight.ToString() + "px; background:white; float:left\"&gt;\n"); } public override void RenderEndTag(HtmlTextWriter writer) { base.RenderEndTag(writer); writer.Write("&lt;/div&gt;\n"); writer.Write("&lt;div class=\"roundedcornr_rside\" style=\"height:" + BoxHeight.ToString() + "px\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"clear\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"roundedcornr_bl\"&gt;&lt;/div&gt;\n"); writer.Write("&lt;div class=\"roundedcornr_btm\" style=\"width:" + BoxWidth.ToString() + "px\"&gt;&lt;/div&gt;"); writer.Write("&lt;div class=\"roundedcornr_br\"&gt;&lt;/div&gt;"); writer.Write("&lt;div class=\"clear\"&gt;&lt;/div&gt;\n"); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload