How to set the default date for the ActiveX Calendar Control by using ASP with FrontPage 2003

Article translations Article translations
Article ID: 828900 - View products that this article applies to.
For a Microsoft FrontPage 2002 version of this article, see 291200.

For a Microsoft FrontPage 2000 version of this article, see 289579.
Expand all | Collapse all


When you insert the ActiveX Calendar Control into a Web page in Microsoft Office FrontPage 2003, the default date is set to the date when the page was created. This step-by-step article describes how to use Microsoft Active Server Pages (ASP) to programmatically set the default date value for the ActiveX Calendar Control to the current date.


Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Note You may receive an error message if you copy the examples directly from this article and paste them into FrontPage 2003. The angle brackets (< and >) may appear as escaped HTML code (< and >). To work around this behavior, paste the script into a blank Notepad document, and then copy it from Notepad before you paste it into FrontPage 2003.

To use ASP to set the default date for the ActiveX Calendar Control, follow these steps:
  1. Start FrontPage 2003, and then open a Web page on a Microsoft Internet Information Services (IIS) Web server.
  2. On the File menu, click New.
  3. In the New pane, click Blank page.
  4. Insert the Calendar Control into the blank page. To do this, follow these steps:
    1. On the Insert menu, click Web Component.
    2. Under Component type, click Advanced Controls.
    3. Under Choose a control, click ActiveX Control, and then click Next.
    4. Click Calendar Control 11.0, and then click Finish.
  5. At the bottom of the Web page pane, click Code.
  6. Find the section of code that is similar to the following:
    <param name="Year" value="2003">
    <param name="Month" value="7">
    <param name="Day" value="22">
    Change the code to look similar to the following:
    <param name="Year" value="<%=Year(Date())%>">
    <param name="Month" value="<%=Month(Date())%>">
    <param name="Day" value="<%=Day(Date())%>">
  7. At the bottom of the Web page pane, click Design.
  8. On the File menu, click Save.
  9. In the Save As dialog box, in the File name box, type calendar.asp, and then click Save to save the page with an ASP extension.
When you open the page in your Web browser, the ASP code automatically sets the default date based on the current date.


Article ID: 828900 - Last Review: January 6, 2006 - Revision: 4.3
  • Microsoft Office FrontPage 2003
kbcalendar kbasp kbhowto KB828900

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from