Tutorial search

Tutorials
Stuff
Affiliates

Cool Stuff




The fastest way to master the basics of Adobe Photoshop

Click here to find out how

Photoshop Templates


Featured Photoshop templates - professional ready to use designs for your next project.

View all templates

ASP.NET Calendar example - ASP.NET tutorial


This example shows you how to use the calendar component and get the date that the user have clicked on
Category: ASP.NET tutorials - Difficulty:




This is an example of a calendar control. In this example whatever date you select it will appear on the label.

Step 1

First of all, Open Microsoft Visual Studio and create a new website ( File->New->web Site ).

Step 2

Here you can write the name of your website. By default it is website1, website2 etc.

Step 3

Design window - Here we can design our page.

Step 4

Insert a Calendar component: open toolbox->Double click on Calendar.

Step 5

Now add a label from the tool box.

Step 6

Now it’s time to add some code to the calendar.

Step 7

This is the coding written on date_selected event. And Label1.text =”Selected Date Is”+calender1.selecteddate.toshortdatestring ();

Step 8

Now run your project.

Step 9

When you click on a date within the calendar the label will show the date which you have selected. See the picture below.

Step 10

As you can see that label is showing the date of the calendar.