473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Putting a date in a .ASPX page

I'm switching some .ASP files over to .ASPX. Some of those .ASP pages
had the current date posted in them using:

**************************
<%=Date()%> or <%=Now()%>
**************************

and they worked just fine, but once I changed them to .ASPX, i get an
error like this:

**************************
Compiler Error Message: CS0103: The name 'Date' does not exist in the
class or namespace 'ASP.mypage_aspx'
**************************

How do I call the date on an .ASPX page?
Nov 18 '05 #1
2 8987
fully qualify the DateTime namespace

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"BoBo the monkey" <co*******@hotmail.com> wrote in message
news:ad**************************@posting.google.c om...
I'm switching some .ASP files over to .ASPX. Some of those .ASP pages
had the current date posted in them using:

**************************
<%=Date()%> or <%=Now()%>
**************************

and they worked just fine, but once I changed them to .ASPX, i get an
error like this:

**************************
Compiler Error Message: CS0103: The name 'Date' does not exist in the
class or namespace 'ASP.mypage_aspx'
**************************

How do I call the date on an .ASPX page?

Nov 18 '05 #2
DateTime.Now is how you get the current time in .NET.

"BoBo the monkey" <co*******@hotmail.com> wrote in message
news:ad**************************@posting.google.c om...
I'm switching some .ASP files over to .ASPX. Some of those .ASP pages
had the current date posted in them using:

**************************
<%=Date()%> or <%=Now()%>
**************************

and they worked just fine, but once I changed them to .ASPX, i get an
error like this:

**************************
Compiler Error Message: CS0103: The name 'Date' does not exist in the
class or namespace 'ASP.mypage_aspx'
**************************

How do I call the date on an .ASPX page?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Neo | last post by:
I use CompareValidator to validate a date. But CompareValidator can only one date format at one time. if the dateorder is "mdy", date format can only be mdy even if date format is ymd. But users...
1
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to...
12
by: Diego | last post by:
Can I validate (possibly with a compare validator) a Date entered by the user based upon his regional settings? I.e. if a user is american the format would be mm/dd/yyyy, if brittish dd/mm/yyyy...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
4
by: sck10 | last post by:
Hello, I created an ashx file for my rss feed (rss.ashx). I notice on the site (http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml) that the date (Yesterday, October 30, 2006, 3:02:37 PM)...
2
by: Sunfire | last post by:
I put some code in the master page load event and find that for some reason, all of the stuff on the page got moved down 2 lines. Is there any way to fix this?
2
by: Bob | last post by:
Hi, i want to pass the date/time from one page to another page like this: firts page: --------- <asp:HyperLink ID="HyperLink1" NavigateUrl="mypage.aspx?dat= & 'date.now'"...
3
by: Bob | last post by:
Hi, i want to pass the date/time from one page to another page like this: firts page: --------- <asp:HyperLink ID="HyperLink1" NavigateUrl="mypage.aspx?dat= & 'date.now'"...
2
by: agarwalsunitadhn | last post by:
hi i want to know that how to create a home page that will open at the time of putting the site address only at the address bar. Like when we click the site Google.com then it open some page like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.