• How to use Calendar in ASP.NET

    by  • May 18, 2013 • Microsoft .NET C# (C-Sharp), Microsoft ASP.NET • 0 Comments

    ASP.NET provides a simple calendar control to use calendar and select date in your page. Like other controls of ASP.NET, calendar control has attributes and events which you can you to achieve your desired functionality. You can also set different themes and styles for this calendar control. This is very flexible control and you can attach selected date with label of text box.

    Here is the calendar control example in ASP.NET. You can also download code at the bottom.

    First look at the aspx page code

    I have used a label and a Text Box to display the select date. In calendar control you can see, I have set different attributes of the control. You can set these and many other attributes according to your requirements. I have also used an event of Calendar control which is OnSelectionChanged.  We can display or use selected date in this event.

    Now see the OnSelectionChanged event of Calendar control in Code behind file (C#)

    You can see, I have simply assigned selected data of Calendar control to Label and Text Box in OnSelectionChanged event.




    Namecheap.com
    Avatar of GetCodeSnippet.com

    About

    GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    Leave a Reply