عدم نمایش jquerydataTables

بپرسید
  • iran58 iran58
  • 74 ماه قبل
  • 74 ماه قبل
  • 339 نمایش

0

{{ digitTrunc(content.likes) }}

سلام

من کدهای زیر را نوشته ام

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
  
  
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>
  
  
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>

و

@model IEnumerable<WebApplication26.Models.Form>
  
  
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/Content/DataTables/css/jquery.dataTables.min.css" rel="stylesheet" />
<h2>Index</h2>
  
  
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table" id="assets-data-table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FrmName)
        </th>
        <th></th>
    </tr>
  
  
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.FrmName)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id })
            </td>
        </tr>
    }
  
  
</table>
@section Scripts
  
  
{
    <script src="~/Scripts/DataTables/jquery.dataTables.min.js"></script>
    <script src="~/Scripts/DataTables/dataTables.bootstrap.min.js"></script>
    <script type="text/javascript">
  
  
        $(document).ready(function () {
  
  
            $('#assets-data-table').DataTable( {
                "paging"  :     true,
                "ordering":     true,
                "info"    :     true,
                "filter"  :     true,
                "order"   :     [[ 0, "desc" ]]
            } );
        });
    </script>
}

وقتی کد

$('#assets-data-table').DataTable( {
              "paging"  :     true,
              "ordering":     true,
              "info"    :     true,
              "filter"  :     true,
              "order"   :     [[ 0, "desc" ]]
          } );

درج نکرده ام هیچ اروری وجود ندارد و البته jquerydataTables هم کار نمیکند

ولی وقتی کد بارا مینویسم

برنامه اجرا میشود ولی در Console ارور زیر رخ میدهد برای حل مشکل چکار باید کنم

سلام
من کدهای زیر را نوشته ام
<c#>
<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8 />
    <meta name=viewport content=width=device-width, initial-scale=1.0>
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render(~/Content/css)
    @Scripts.Render(~/bundles/modernizr)
  
  
</head>
<body>
    <div class=navbar navbar-inverse navbar-fixed-top>
        <div class=container>
            <div class=navbar-header>
                <button type=button class=navbar-toggle data-toggle=collapse data-target=.navbar-collapse>
                    <span class=icon-bar></span>
                    <span class=icon-bar></span>
                    <span class=icon-bar></span>
                </button>
                @Html.ActionLink(Application name, Index, Home, new { area =  }, new { @class = navbar-brand })
            </div>
            <div class=navbar-collapse collapse>
                <ul class=nav navbar-nav>
                    <li>@Html.ActionLink(Home, Index, Home)</li>
                    <li>@Html.ActionLink(About, About, Home)</li>
                    <li>@Html.ActionLink(Contact, Contact, Home)</li>
                </ul>
            </div>
        </div>
    </div>
    <div class=container body-content>
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>
  
  
    @Scripts.Render(~/bundles/jquery)
    @Scripts.Render(~/bundles/bootstrap)
    @RenderSection(scripts, required: false)
</body>
</html>
<c#>
و
<c#>
@model IEnumerable<WebApplication26.Models.Form>
  
  
@{
    ViewBag.Title = Index;
    Layout = ~/Views/Shared/_Layout.cshtml;
}
<link href=~/Content/DataTables/css/jquery.dataTables.min.css rel=stylesheet />
<h2>Index</h2>
  
  
<p>
    @Html.ActionLink(Create New, Create)
</p>
<table class=table id=assets-data-table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FrmName)
        </th>
        <th></th>
    </tr>
  
  
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.FrmName)
            </td>
            <td>
                @Html.ActionLink(Edit, Edit, new { id = item.Id }) |
                @Html.ActionLink(Details, Details, new { id = item.Id }) |
                @Html.ActionLink(Delete, Delete, new { id = item.Id })
            </td>
        </tr>
    }
  
  
</table>
@section Scripts
  
  
{
    <script src=~/Scripts/DataTables/jquery.dataTables.min.js></script>
    <script src=~/Scripts/DataTables/dataTables.bootstrap.min.js></script>
    <script type=text/javascript>
  
  
        $(document).ready(function () {
  
  
            $('#assets-data-table').DataTable( {
                paging  :     true,
                ordering:     true,
                info    :     true,
                filter  :     true,
                order   :     [[ 0, desc ]]
            } );
        });
    </script>
}
<c#>
وقتی کد
<js>
$('#assets-data-table').DataTable( {
              paging  :     true,
              ordering:     true,
              info    :     true,
              filter  :     true,
              order   :     [[ 0, desc ]]
          } );
<js>
درج نکرده ام هیچ اروری وجود ندارد و البته jquerydataTables هم کار نمیکند
ولی وقتی کد بارا مینویسم
برنامه اجرا میشود ولی در Console ارور زیر رخ میدهد برای حل مشکل چکار باید کنم
||https://tosinso.com/files/get/3a998ff7-f6b6-4b37-b103-80711a97b0ac||
دوره های شبکه، برنامه نویسی، مجازی سازی، امنیت، نفوذ و ... با برترین های ایران

پاسخ ها به این سوال

پاسخ ها به این سوال

{{ digitTrunc(post.likes) }}

این پست در تاریخ {{ dateString(new Date(post.deleteDate)) }} توسط {{ post.deletedByUser }} حذف شده است.

دلیل حذف: {{ post.deleteReason ?? 'نامشخص' }}

{{ err }}
{{ post.userAchivements.rhodiumAchievements }}
{{ post.userAchivements.platinumAchievements }}
{{ post.userAchivements.goldAchievements }}
{{ post.userAchivements.silverAchievements }}
{{ post.userAchivements.bronzeAchievements }}
{{ timeSince(new Date(post.date)) }} قبل

برای ثبت پاسخ خود در وب سایت وارد حساب کاربری خود شوید
قابلیت ارسال مطلب توسط مدیریت سایت غیر فعال شده است