First, there is the DefaultValue for the code behind, which does not act as a default value, but as a default property value for the properties window. Here is the Default Property Value for the properties window set in the ascx.cs page:
Now, what you really want is the default value for the control to be set in the ascx page as follows:
[Browsable(true)]
[DefaultValue("")]
public string Text
{
get { return Label.Text; }
set { Label.Text = value;
}
}
You can then manipulate the value in the DataBind, CreateChildControls, or Property section. Be aware that the property section doesn't necessarily fire, hence the need to use the ascx properties.
<asp:Label ID="Label" runat="server" Text=""></asp:Label>
1 comment:
Hi, Early on with your planning stage, come up with at least three color schemes in Web Design Cochin. Some of the common are: blue and white; red, yellow and white; and blue, orange and white.Thanks....
Post a Comment