Jquery calender as a dropdown to select month and year in asp.net
In .aspx page In head section
<script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type = "text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type = "text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel = "Stylesheet" type="text/css" />
<script type ="text/javascript">
$(function () {
$("#txtDateOfBirth").datepicker({
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true,
yearRange: '-100y:c+nn',
maxDate: '-1d'
});
});
</script>
In body section --
<asp:TextBox ID=" <asp:TextBox ID="txtDateOfBirth" runat="server"
></asp:TextBox>
" runat="server"
></asp:TextBox>
In .aspx page In head section
<script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type = "text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type = "text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel = "Stylesheet" type="text/css" />
<script type ="text/javascript">
$(function () {
$("#txtDateOfBirth").datepicker({
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true,
yearRange: '-100y:c+nn',
maxDate: '-1d'
});
});
</script>
In body section --
<asp:TextBox ID=" <asp:TextBox ID="txtDateOfBirth" runat="server"
></asp:TextBox>
" runat="server"
></asp:TextBox>
No comments:
Post a Comment