MVC4 jQuery UI does not work

后端 未结 4 539
刺人心
刺人心 2020-12-18 13:26

I cannot get jQuery UI working in my ASP.NET MVC4 application. I tried dialog and datepicker. Here is part of the code of my view.



        
4条回答
  •  眼角桃花
    2020-12-18 13:33

    I spent lots of time to figure out how to make it working.

    Finally the steps are following:

    1. Create ASP .NET MVC4 project Internet Application.

    2. Clean some of the last lines of the _Layout.cshtml so it should look like this

      © @DateTime.Now.Year - My ASP.NET MVC Application

      @RenderSection("scripts", required: false)

    3. Change header like I did here

     
            
            @ViewBag.Title - My ASP.NET MVC Application
            
            
            @Styles.Render("~/Content/css")
            @Styles.Render("~/Content/themes/base/css")
            @Scripts.Render("~/bundles/jquery")
            @Scripts.Render("~/bundles/jqueryui")
            @Scripts.Render("~/bundles/modernizr")
            
        
    
    1. Delete all code after @section featured { section and add some html to Home/Index.cshtml

      A. Put some code from the view source link of http://jqueryui.com/tabs/ page (It is inside of < div id="tabs" > ... < div >)

      B. Add this


    < div > Date: < input id="datep" type="text" / > < / div >

    DONE!!!

    enter image description here

提交回复
热议问题