Computing.Net > Forums > Web Development > ASP Date

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ASP Date

Reply to Message Icon

Name: simonscholey
Date: September 3, 2006 at 09:09:13 Pacific
OS: Windows XP Professional S
CPU/Ram: AMD Athlon XP 2800 1Gb
Product: Home Built
Comment:

Hey

I would like to insert the current date into an .aspx page. Surely this can't be that hard?! I have done a Google search but couldn't get the examples of <%=Date()%> to work. I'm assuming I'm missing something?!

Can anybody explain to me how to do it.

Thanks in advance.

Simon

MSI KT4AV-L
AMD Athlon XP 2800
1Gb Crucial 3200 DDR
160Gb Seagate Barracuda
ATI 256Mb 9600XT
16x DL DF DVD/RW
16x DVD ROM
9-in-1 Flash Media FDD
Windows XP Pro/Vista Beta 2



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: September 4, 2006 at 19:55:53 Pacific
Reply:

There are plenty of ways to do this kind of thing, so choosing one is harder than actually doing the work :-) For most dynamic content, you would put only a placeholder into the .aspx page, and put code to fill its content into the code-behind VB.NET or C# file.

However, for something as simple as a date, using inline code may make sense. I haven't tried it myself, but I'd guess this will work:
<%=DateTime.Today.ToString()%>

Good luck,
-SN


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: ASP Date

Date pop-up box in ASP.NET www.computing.net/answers/webdevel/date-popup-box-in-aspnet/833.html

ASP.Net Date Format www.computing.net/answers/webdevel/aspnet-date-format/3014.html

ASP Make New Fields www.computing.net/answers/webdevel/asp-make-new-fields/1394.html