Hi aricahugo,
Use below command in the Package Manager console window to install the jQuery.UI.Widgets.Datepicker.
Install-Package jQuery.UI.Combined -Version 1.12.1
Or you can download jquery-ui package and than put files from package to your project.
https://jqueryui.com/download/
Or use the cdn link to apply DatePicker in your code.
Refer below article.
After successfully install the jquery.ui package the js files are save in Scripts folder and the css are saved in Content inside the solution explorer.
You need to drag and drop the js and css file in the page header section to use the datepicker.
Refer below example.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.12.4.js"></script>
<script src="Scripts/jquery-ui-1.12.1.js"></script>
<link href="Content/themes/base/jquery-ui.css" rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="txtDate" runat="server" ReadOnly="true"></asp:TextBox>
<hr />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" />
<script type="text/javascript">
$(function () {
$("[id*=txtDate]").datepicker({
showOn: 'button',
buttonImageOnly: true,
buttonImage: 'images/calendar.png'
});
});
</script>
</form>
</body>
</html>
Code
C#
protected void btnSubmit_Click(object sender, EventArgs e)
{
string dt = Request.Form[txtDate.UniqueID];
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Selected Date: " + dt + "');", true);
}
VB.Net
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim dt As String = Request.Form(txtDate.UniqueID)
ClientScript.RegisterStartupScript(Me.GetType(), "alert", "alert('Selected Date: " & dt & "');", True)
End Sub
Screenshot