or
dataSource: new kendo.data.DataSource({ type: "json", transport: { read: { url: "GetZones", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", data: { __RequestVerificationToken: $("input[name=__RequestVerificationToken]").val() } //sendAntiForgery() }, parameterMap: function (options) { return JSON.stringify(options); } }}; However in fiddler I get the following error: {"error":"Invalid JSON primitive: __RequestVerificationToken=cVKwXnuusO7LVzfoTYk2FD4S5BhSstIULlN0uzspliMOByr/OFRMpbaeLT4i84lpqZZPuzNyUzuhqULNEA/WyljOuD17gycOs2yQGfNlHq1GrX7/QcW3l0RC30RAXA9ruyLRuvCBLNOASqsMUSBb4wIyzxMj4mLrZZNdqk4JWyo=."} I found out that the token is send out twice as you can see in the following request body:
Is possible automatically add a string (?width=300) to the src of an image tag when I insert an image with Editor?
<img src="images/myimage.jpg?width=300 />
The reason is that I’m using imageresizer for my thumbnails and I really like it.
/Stefan
@(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(p => p.Title); columns.Bound(p => p.Author); columns.Bound(p => p.BookGenreId); columns.Bound(p => p.ReleaseDate); columns.Bound(p => p.ISBN); columns.Bound(p => p.Count); columns.Bound(p => p.AddDate); columns.Bound(p => p.ModifiedDate); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200); }) .ToolBar(toolbar => toolbar.Create()) .Editable(editable => editable.Mode(GridEditMode.InLine)) .Pageable() .Sortable() .Scrollable() .Filterable() .DataSource(dataSource => dataSource .Server() // Specify that the ProductID property is the unique identifier of the model .Model(model => model.Id(p => p.BookId)) .Create(create => create.Action("Create", "Books")) .Read(read => read.Action("Index", "Books")) .Update(update => update.Action("Update", "Books")) .Destroy(destroy => destroy.Action("Destroy", "Books")) ))
Resolved by
.Model(model =>
{
//The unique identifier (primary key) of the model is the ProductID property
model.Id(p => p.BookId);
model.Field(p => p.ModifiedDate).Editable(false);
model.Field(p => p.AddDate).Editable(false);
})