I'm trying to set a property on a custom DropDownList:
<custom:ReferenceDropDownList ... ValidityDate="<%# Application.CreateDate %>" />
Even though I can see that Application.CreateDate has been set in the Page_Load method on the containing UserControl, the code-behind in the DDL never seems to pick it up.
protected override void OnLoad(EventArgs e)
{
// this.ValidityDate is always null
}
This is even the case with ValidityDate="<%# DateTime.Now %>"
. The property of the DDL is declared like this:
[Category("Data")]
[DefaultValue(null)]
public DateTime? ValidityDate { get; set; }
Does anyone know what is the correct sequence I should be following here. I thought that a DDL would evaluate a cynamic property value like that without too much trouble.