Reputation: 25181
Is something similiar to the following pseduocode possible on server side controls?
<asp:Label runat="server" ID="lbl" Text=<%=DateTime.Now.ToString(); %> />
I.e. assigning attributes.
Upvotes: 1
Views: 5826
Reputation: 43117
This will work for databound controls, e.g.
<asp:Label runat="server" ID="lbl" Text="<%# DateTime.Now.ToString() %>" />
Then in your code behind, you'll need to call lbl.DataBind()
.
Upvotes: 1
Reputation: 46077
Try this:
<asp:Label runat="server" ID="lbl" Text='<%=DateTime.Now.ToString()%>' />
Upvotes: 1