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
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
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()%>
Summary: Hi all, I have a simple ASP.NET question here. I wanna to create a button which can pop-up a 'date pop-up box' for user to select her preference date. For example, just like the date (bottom right-co...
Summary: Hi all, I am facing a problem now. I am using ASP.net 2.0. During deployment of the web application on one of the servers, the date format is dd/MM/yyyy, which is correct. But when I deploy it into an...
Summary: Hi All, I Have A Database With A Table Called "D13". In That Field, There Is A Field Called "Date" With 1/1/05, 2/1/05 And So On. Is It Possible For ASP To Automatically Create Another Line With The N...