Link to home
Start Free TrialLog in
Avatar of Valimai
Valimai

asked on

asp Label id=Label1 runat=server Text="<% =DateTime.Now.ToString() %>"

Hi Experts

I come from an ASP background

How can I do this without writing in the code-behind or creating a function. i want to be able to do a response.write type thing.

<asp:Label id="Label1" runat="server" Text="<% =DateTime.Now.ToString() %>" />

thanks
Avatar of mazkot
mazkot

<asp:Label ID="Label1" Runat="server">
      <code>date.now()</code>
</asp:Label>
Avatar of Ryan Chong
you can also try set the label's text at Page_Load event, like:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Label1.Text = DateTime.Now.ToString()
    End Sub
try

<asp:Label ID="Label1" Runat="server"><%=Date.Now%></asp:Label>
ASKER CERTIFIED SOLUTION
Avatar of bsdotnet
bsdotnet

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial