Hi!
Konyha_Id problem ceased.
My new problems are:
1. In the _Layout.cshtml:
@Styles.Render("~/Content/ej/web/material/ej.web.all.min.css")
@*@Scripts.Render("~/Scripts/jquery-3.2.1.min.js")
@Scripts.Render("~/Scripts/jsrender.min.js")
@Scripts.Render("~/Scripts/ej/ej.web.all.min.js")*@
@*@Scripts.Render("~/bundles/ejscripts")*@
@*<link rel="stylesheet" rel='nofollow' href="http://cdn.syncfusion.com/15.4.0.17/js/web/flat-azure/ej.web.all.min.css" />*@
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://cdn.syncfusion.com/15.4.0.17/js/web/ej.web.all.min.js"></script>
<script src="http://cdn.syncfusion.com/15.4.0.17/js/common/ej.unobtrusive.min.js"></script>
As you can see, Scripts.Render not working, therefore I change that to cdn.
The new project made by Syncfusion ASP.NET MVC Application template.
2. I want to use Areas, I made a new _Layout.cshtml in my area. I transposed the above code to its layout file.
In that area, @Html.EJ().ScriptManager() isn't working.
"Error CS1061 'HtmlHelper<dynamic>' does not contain a definition for 'EJ' ... "
3. So grid is working (almost) in the default _layout.
I have the following datasource in the controller:
public ActionResult Index()
{
var uzenetek = db.Uzenet.ToList();
ViewBag.datasource = uzenetek;
return View();
}
There is content in it (attached image: "uzenetek"). But the row doesn't appear in the grid. Header is OK.
Grid in the Index.cshtml:
<div class="col-md-8 col-md-offset-2">
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.Columns(col =>
{
col.Field("Id").HeaderText("Azonosító").TextAlign(TextAlign.Right).Width(40).Add();
col.Field("Cim").HeaderText("Cím").TextAlign(TextAlign.Left).Width(75).Add();
col.Field("Szoveg").HeaderText("Szöveg").Width(200).Add();
})
)
</div>
I would appreciate your help.
Thank you!
Attila László
Attachment:
uzenetek_93536f67.rar