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

Posted on 2006-04-06
Last Modified: 2008-02-01
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() %>" />

Question by:Valimai
    LVL 3

    Expert Comment

    <asp:Label ID="Label1" Runat="server">
    LVL 48

    Expert Comment

    by: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
    LVL 39

    Expert Comment


    <asp:Label ID="Label1" Runat="server"><%=Date.Now%></asp:Label>
    LVL 12

    Accepted Solution

    <asp:Label ID="Label1" runat="server" ><%=DateTime.Now%></asp:Label>

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now