Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Jowita #1
DefaultValue attribute doesn't get set in a composite custom control
I have a simple composite control with the following attributes:
[
Bindable(true),
Category("Appearance"),
DefaultValue("Enter name:"),
Description("The text for the name label.")
]
public string NameLabelText
{
get
{
EnsureChildControls();
return nameLabel.Text;
}
set
{
EnsureChildControls();
nameLabel.Text = value;
}
}
However, when I drop the control on the page, the property is NOT set
to the DefaultValue. It is blank.
Can someone help me and explain why the default value doesn't work?
Thanks
J
Jowita Guest
-
Composite Control with FormView property tag prefix attribute?
Hi, I've developed a Composite control designed to take one FormView and one SqlDataSource as properties. I can add my composite control to the... -
Composite Control default style attribute
I have a composite control that after dragging it onto the webform adds the following style attribute to the control: style="Z-INDEX: 101; LEFT:... -
Problems in Composite Custom Control
Hi everybody, I am trying to a build an ASP .Net Custom Control(in C#) which will create a table ( with variable number of rows) dynamically based... -
Using XSLT in a custom composite control
Yes, that says it all. I am trying to use XSLT to render the pre/post parts of the composite control in order to keep the look apart from the... -
Using Table control in a custom composite control. Control does not render properly in design time.
All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control... -
Christoph Richter [AT] #2
Re: DefaultValue attribute doesn't get set in a composite custom control
That behaviour is per default.
all Standard classes have an if(value == null) implemented to catch
that.
the default value is for the Designer. so if you see the Properties of
your dropped control(normally in the lower right pane), you see there
the default values, that don't need to be set (so you have an code
that is easier to read)
cheers
christoph
On 14 Jun 2006 11:49:01 -0700, "Jowita" <jowi6@hotmail.com> wrote:
>
>
>I have a simple composite control with the following attributes:
>
> [
> Bindable(true),
> Category("Appearance"),
> DefaultValue("Enter name:"),
> Description("The text for the name label.")
> ]
> public string NameLabelText
> {
> get
> {
> EnsureChildControls();
> return nameLabel.Text;
> }
> set
> {
> EnsureChildControls();
> nameLabel.Text = value;
> }
> }
>
>However, when I drop the control on the page, the property is NOT set
>to the DefaultValue. It is blank.
>Can someone help me and explain why the default value doesn't work?
>
>Thanks
>
>JChristoph Richter [AT] Guest



Reply With Quote

