Telerik Date,Time and Datetime Controls
Telerik Date,Time and Datetime Controls
Step 1: Design on web form .aspx page
<div>
<asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager>
<h2>Telerik DatePicker</h2>
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">
<DateInput ID="DateInput1" runat="server" DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy" />
<Calendar ID="Calendar1" runat="server" ViewSelectorText="dd/MM/yyyy" TitleFormat="dd/MM/yyyy" />
</telerik:RadDatePicker>
<h2>Telerik TimePicker</h2>
<telerik:RadTimePicker ID="RadTimePicker1" runat="server">
<DateInput runat="server" DateFormat="HH:mm:ss" ToolTip="Date
input">
</DateInput>
<TimeView runat="server" TimeFormat="HH:mm:ss">
</TimeView>
</telerik:RadTimePicker>
<h2>Telerik TimePicker</h2>
<telerik:RadDateTimePicker ID="datetime" runat="server"></telerik:RadDateTimePicker>
<br />
<br />
<telerik:RadButton ID="btn" Text="Test" runat="server" OnClick="btn_Click"></telerik:RadButton>
<br />
<asp:Label ID="view" runat="server"></asp:Label>
</div>
Step 2: Logic on .CS page
protected void btn_Click(object sender, EventArgs e)
{
view.Text = "Date Is :" +
RadDatePicker1.SelectedDate + "</br>" + "Time Is :" + RadTimePicker1.SelectedTime + "</br>" + "DateTime Is :" +
datetime.SelectedDate;
}
Comments
Post a Comment