D
dan
Hi NG,
i am developing an asp.net Custom control which consist of some TextBoxes,
Button, ... .
To let the user of that control set for example the width of the TextBox,
the class has a property like this:
private int widthTextBox;
[Bindable(true),
Category("Appearance"),
DefaultValue(150)] //***
public int WidthTextBox
{
get
{
EnsureChildControls();
return widthTextBox;
}
set
{
EnsureChildControls();
widthTextBox = value;
}
}
The Render(HtmlTextWriter output)assigns this value to the TexBox
protected override void Render(HtmlTextWriter output)
{
UserName.Width=Unit.Pixel(WidthTextBox);
base.Render(output);
}
But the DefaultValue(150) doesn't do anything. When the user doesn't set the
WidthTextBox Property, the TextBox has "Width:0px".
What 's wrong there?
thanks,
Dan
i am developing an asp.net Custom control which consist of some TextBoxes,
Button, ... .
To let the user of that control set for example the width of the TextBox,
the class has a property like this:
private int widthTextBox;
[Bindable(true),
Category("Appearance"),
DefaultValue(150)] //***
public int WidthTextBox
{
get
{
EnsureChildControls();
return widthTextBox;
}
set
{
EnsureChildControls();
widthTextBox = value;
}
}
The Render(HtmlTextWriter output)assigns this value to the TexBox
protected override void Render(HtmlTextWriter output)
{
UserName.Width=Unit.Pixel(WidthTextBox);
base.Render(output);
}
But the DefaultValue(150) doesn't do anything. When the user doesn't set the
WidthTextBox Property, the TextBox has "Width:0px".
What 's wrong there?
thanks,
Dan