| using System;
|
| 1:using System.Web.UI;
|
| 2:using System.Web.UI.WebControls;
|
| 3:using System.ComponentModel;
|
| 4:using System.Text;
|
| 5:using System.IO;
|
| 6:
|
| 7:namespace Arindam
|
| 8:{
|
| 9:
|
| 10: [DefaultProperty("Text"),
|
| 11: ToolboxData("<{0}:CodeContainer runat=server></{0}:CodeContainer>")]
|
| 12: public class MyCustomControl: System.Web.UI.WebControls.WebControl,INamingContainer
|
| 13: {
|
| 14: string _clientScriptPath = "";
|
| 15: Panel objPanel;
|
| 16: Literal objLtrl;
|
| 17: Label objLab;
|
| 18:
|
| 19: protected override void CreateChildControls()
|
| 20: {
|
| 21:
|
| 22: objPanel=new Panel();
|
| 23: objLtrl=new Literal ();
|
| 24: objLab=new Label();
|
| 25:
|
| 26: objPanel.ID ="CodeZone";
|
| 27:
|
| 28: objLab.Text = this.Title;
|
| 29:
|
| 30: objLab.Font.Bold = true;
|
| 31: objLab.BorderWidth = Unit.Pixel(1);
|
| 32: objLab.BorderStyle = BorderStyle.Dotted;
|
| 33: objLab.BorderColor = System.Drawing.Color.FromName("#A0A0A1");
|
| 34: // int _imgwidth = objImg == null ? 0 : (int)objImg.Width;
|
| 35: objLab.Width = Unit.Pixel(this.AreaWidth - 14);
|
| 36: objLtrl.Text = this.Text ;
|
| 37:
|
| 38: objPanel.BackColor = System.Drawing.Color.Cornsilk ;
|
| 39: objPanel.Height = Unit.Pixel(this.AreaHeight) ;
|
| 40: objPanel.Width = Unit.Pixel(this.AreaWidth) ;
|
| 41: objPanel.BorderWidth = Unit.Pixel(1);
|
| 42: objPanel.Controls.Add(objLtrl);
|
| 43:
|
| 44:// set rendering order here .
|
| 45: Controls.Add(objImg);
|
| 46: Controls.Add(objLab);
|
| 47: Controls.Add(objPanel);
|
| 48:
|
| 49:
|
| 50:
|
| 51: base.CreateChildControls ();
|
| 52: }
|
| 53: }
|
| 54:}
|
| 55: |