aditya immadi

aditya immadi

  • NA
  • 215
  • 22.1k

date picker is not a function

Sep 27 2016 5:39 AM
hai all i wrote these lines for datepicker ..it says date ppicker is not a fuhnction i m sharing my code here.i googled but i cant find anything new .can anyone help me out 
TIA
 
@model CalenderEvents.Models.Tb_Calender
@{
ViewBag.Title = "Calender";
}
<a href="~/Views/Home/Calender.cshtml">~/Views/Home/Calender.cshtml</a>
<script src="~/Scripts/jquery-1.7.1.js"></script>
<script src="~/Scripts/jquery-ui-1.8.20.js"></script>
@section scripts{
@Scripts.Render("~/Content/cssjqryUi")
@Scripts.Render("~/bundles/jquery")
<script type="text/ecmascript">
$(document).ready(function () {
$("#datepicker").datepicker();
});
</script>
}
<h2>Calender</h2>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Tb_Calender</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Date)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Date, new { @id="datepicker"})
@Html.ValidationMessageFor(model => model.Date)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Events)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Events)
@Html.ValidationMessageFor(model => model.Events)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Remarks)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Remarks)
@Html.ValidationMessageFor(model => model.Remarks)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
and in Bundle config.cs
 
 
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
//css
bundles.Add(new StyleBundle("~/Content/cssjqryUi").Include(
"~/Content/jquery-ui.css"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css",
"~/Content/jquery-ui.css"));
 
whee did i went wrong ... 

Answers (4)