Putting a date in a .ASPX page

Discussion in 'ASP .Net' started by BoBo the monkey, Mar 5, 2004.

  1. 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?
     
    BoBo the monkey, Mar 5, 2004
    #1
    1. Advertising

  2. BoBo the monkey

    Curt_C [MVP] Guest

    fully qualify the DateTime namespace

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "BoBo the monkey" <> wrote in message
    news:...
    > 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?
     
    Curt_C [MVP], Mar 5, 2004
    #2
    1. Advertising

  3. DateTime.Now is how you get the current time in .NET.

    "BoBo the monkey" <> wrote in message
    news:...
    > 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?
     
    Peter Rilling, Mar 6, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GaryB
    Replies:
    6
    Views:
    360
    Steven Cheng[MSFT]
    Nov 15, 2004
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,380
    Michael Borgwardt
    May 30, 2004
  3. Saurabh
    Replies:
    6
    Views:
    4,623
    Chris Smith
    May 30, 2004
  4. UJ
    Replies:
    1
    Views:
    400
    Steve C. Orr [MVP, MCSD]
    Jul 18, 2006
  5. GaryB

    Putting ASPX functionality into a component

    GaryB, Nov 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    116
    GaryB
    Nov 12, 2004
Loading...

Share This Page