Net-informations.com
SiteMap  | About    

Calendar control

The Calendar control is used to display a calendar in the browser. The control allows you to select dates and move to the next or previous month.

calender-control

You can customize the appearance of the Calendar control by setting the properties that control the style for different parts of the control. The following ASP.NET program display the selected Calender date in short date format in a label control.

vb.net

  Label1.Text = Calendar1.SelectedDate.ToShortDateString()

C#

  Label1.Text = Calendar1.SelectedDate.ToShortDateString();

Default.aspx

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>Untitled Page</title>
</head>
<body>
	<form id="form1" runat="server">
	<div>
		<asp:Calendar ID="Calendar1" runat="server"
			onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>
		<br />
		<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
	</div>
	</form>
</body>
</html>


Click the following links to see full source code

C# Source Code
VB.NET Source Code
default.aspx.cs
default.aspx.vb






net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.