Iran58
سه شنبه 22 اسفند 1396, 09:57 صبح
سلام
من کدهای زیر را نوشته ام
<!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>© @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 ارور زیر رخ میدهد برای حل مشکل چکار باید کنم
147796
من کدهای زیر را نوشته ام
<!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>© @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 ارور زیر رخ میدهد برای حل مشکل چکار باید کنم
147796