Hi everybody,
I've tried to create a new user control which I'm calling at the page like this
UndoSave:UndoSaveButtons ID="btnRegular" runat="server" CreatedOn ='< %# Bind("CreatedOn")% >' LastUpdated = '< %# Bind("LastUpdated")'
CreatedOn and LastUpdated are datetime fields from the database that I'm getting using a stored procedure.
In my user control I defined them as DateTime like this
[Bindable(true, BindingDirection.TwoWay), Category("User-Defined")]
public DateTime CreatedOn
{
set
{
this.litCreatedOn.Text = value.ToShortDateString() ;
}
}
May be I have to add get for this property?
I'm getting an error Error 1 Cannot create an object of type 'System.DateTime' from its string representation '< %# Bind("LastUpdated")' for the 'LastUpdated' property.
Do you know what could be wrong here and how can I fix the problem?
Thanks in advance.
UPDATE. Disregard, it was just my own typo.
If it's not broken, fix it until it is.
My Blog