IMPLEMENT A CALENDER EXTENDER IN ASP.NET MVC TEXTBOXFOR
FIRST COPY AND PASTE THESE CSS AND JAVASCRIPT IN YOUR VIEW
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="//code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true
});
</script>
THEN IN POSITION FOR YOUR CALENDER WRITE THE CODE
<div class="editor-field">
@Html.TextBoxFor(model => model.NSF_DOJ, new { id = "datepicker" })
</div>
NOTE: here NSF_DOJ will contain your calender date
eg- string joinDate = ntf.NSF_DOJ;
ntf.NSF_DOJ = joinDate;
THATS ALL
thanks for reading
No comments:
Post a Comment