User Control:
A user control is a kind of composite control that works much like an ASP.NET Web page—you can add existing Web server controls and markup to a user control, and define properties and methods for the control. You can then embed them in ASP.NET Web pages, where they act as a unit.
Here in this example, you can see how to use date picker user control in web page.
For that, create a user control and add CSS and JS files whatever you required for date picker.
- <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DatePicker.ascx.cs" Inherits="CodeSamples.DatePicker" %>
- <link href="css/Jquery-ui.css" rel="stylesheet" />
- <script src="js/jquery-1.10.2.js"></script>
- <script src="js/jquery-ui.js"></script>
- Here take one textbox and bind date picker by using JavaScript.
- <script type="text/javascript">
- $(function () {
- $("#datepicker").datepicker();
- });
- </script>
- Date:
- <input type="text" id="datepicker">


Rafael ChaconPosted Apr 29, 2020, 9:48 AM
This datepicker only works if you use one single instance in the same page. I'm inserting two datepickers and only shows the calendar in the first one, but not in the second one.
Nilesh JadavPosted Aug 17, 2015, 4:35 AM
Nice article sir
Santhakumar MunuswamyPosted Aug 16, 2015, 2:40 AM
Nice article
Mahesh AelakurthiPosted Aug 14, 2015, 5:09 AM
Good Article. Expecting more articles like this from you.