Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
@{
    ViewBag.Title = "testdatetime";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/Content/themes/base/jquery.ui.datepicker.css" rel="stylesheet" />

<link href="~/Content/themes/base/jquery.ui.all.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.7.1.min.js"></script>
<script src="~/Scripts/jquery-1.7.1.js"></script>
<script src="~/Scripts/jquery-ui-1.8.20.js"></script>
<link href="~/Content/themes/base/jquery.ui.theme.css" rel="stylesheet" />
@*<script src="~/Scripts/jquery-ui-1.8.20.min.js"></script>*@
<link href="~/Content/themes/base/jquery.ui.core.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" />
<script src="~/Scripts/jquery.datetimepicker.js"></script>
<script>
    $(function () {
        $('.datepicker').datepicker();
    }
    );
</script>
<h2>testdatetime</h2>
@using(Html.BeginForm())
{
   <input type="text" class="datepicker" />

}
Posted
Comments
[no name] 20-Jun-14 11:20am    
Take your time and effort to explain your problem clearly. We don't do mind reading.

Change your all the references with ~ like below
<script src="<%= Url.Content("~/Scripts/jquery.datetimepicker.js") %>" type="text/javascript"></script>

check Correct way to reference Javascript in ASP.NET MVC?[^]
 
Share this answer
 
v2
Instead of using all of these includes, check your BundleConfig and see if they are bundled there.
It should look something like:
public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/MyBundle").Include(
               "~/Scripts/jquery-{version}.js",
               "~/Scripts/jquery.unobtrusive-ajax.js",
               "~/Scripts/jquery-ui-{version}.js"
            ));
         }


Using Razor syntax, take out all your HTML <link /> tags and add:
@Scripts.Render("~/bundles/MyBundle")


The same can by used for Styles by the way, except the tag is:
@Styles.Render("~/bundles/MyStyles")


This might-well resolve your issue.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900