[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-04-06
4
Medium Priority
?
3,525 Views
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() %>" />

thanks
0
Comment
Question by:Valimai
4 Comments
 
LVL 3

Expert Comment

by:mazkot
ID: 16398218
<asp:Label ID="Label1" Runat="server">
      <code>date.now()</code>
</asp:Label>
0
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 16398266
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
0
 
LVL 39

Expert Comment

by:appari
ID: 16398268
try

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

Accepted Solution

by:
bsdotnet earned 500 total points
ID: 16398269
<asp:Label ID="Label1" runat="server" ><%=DateTime.Now%></asp:Label>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

873 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