Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

HOW TO: Set the Default Date for the Calendar Control by Using ASP in FrontPage 2000


View products that this article applies to.

This article was previously published under Q289579

↑ Back to the top


Summary

When you insert the ActiveX Calendar Control, the default date is set to the date when the page was created. This article describes how to programmatically set the default date value for the ActiveX Calendar Control by using Microsoft Active Server Pages (ASP).

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. 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.

Code Sample

1.Open a web in FrontPage on a Microsoft Internet Information Services Web server.
2.Open a new blank page.
3.Insert the Calendar Control. To do this, follow these steps:
a. On the Insert menu, point to Advanced, and then click ActiveX Control.
b. Select Calendar Control 9.0, and then click OK.
4.Switch to HTML view.
5.Locate the section of code similar to the following:
<param name="Year" value="2000">
<param name="Month" value="1">
<param name="Day" value="1">
					
6.Change the code to the following:
<param name="Year" value="<%=Year(Date())%>">
<param name="Month" value="<%=Month(Date())%>">
<param name="Day" value="<%=Day(Date())%>">
					
7.Switch to Normal view.
8.Save the page with an ASP extension.
When you browse the page by using HTTP, the ASP code automatically creates the default date based on the current date.




↑ Back to the top


References

For a Microsoft FrontPage 2002 version of this article, see 291200.











↑ Back to the top


Keywords: KB289579, kbhowtomaster, kbhowto

↑ Back to the top

Article Info
Article ID : 289579
Revision : 2
Created on : 6/18/2005
Published on : 6/18/2005
Exists online : False
Views : 263