or
@using (Ajax.BeginForm("AddComment", "Incident", new AjaxOptions { HttpMethod = "Post", OnSuccess = "onSuccess('AddWindow')" })){ @Html.ValidationSummary(true) <div class="editor-field"> @(Html.Kendo().EditorFor(model => model.Comment) .Name("Comment") .Tools(tool => tool .Clear() .Bold() .Italic() .Underline() .InsertOrderedList() .InsertUnorderedList() .JustifyLeft() .JustifyCenter() .JustifyRight() .JustifyFull() .Indent() .Outdent() .CreateLink() .Unlink())) @Html.ValidationMessageFor(model => model.Comment) </div> @Html.HiddenFor(model => model.IncidentId) <p> <input type="submit" value="Add Comment" class="k-button" /> </p>}@(Html.Kendo().Window() .Name("AddWindow") .Title("Add Comment") .Content(@<div>@Html.Partial("IncidentCommentAddPartial", Model.AddComment)</div>) .Draggable(true) .Modal(true) .Visible(false) .Width(625) )$('#addComment').click(function (e) { e.preventDefault(); window.center().open(); });
@model DnB.Connect.Mvc.Common.Models.CompanyModel@( Html.Kendo().Window() .Name("DescriptionEdit") .Title("Edit Company Description") .HtmlAttributes(new { style = "width: 650px; height:600px;" }) .Draggable(false) .Visible(false) .Resizable(resizing => resizing .Enabled(false) ) .Modal(true)
.Actions(a=>a.Close()) ) @Html.HiddenFor(m => m.Company.CompanyID, new { id = "CompanyID" })<a id="ShowEditDescription" class="edit right">Edit</a><script type="text/javascript"> $(document).ready(function () { $('#ShowEditDescription').click(function () { var id = $("#CompanyID")[0].value; var param = { id: id }; var sendwindow = $("#DescriptionEdit").data("kendoWindow"); if (sendwindow && sendwindow != undefined) { sendwindow.center().open(); sendwindow.refresh({ url: "/Company/DisplayDescriptionEdit", data: param }); } }); });</script> @model CompanyModel@if (Model != null && Model.Company != null )
{ using (Html.BeginForm("DescriptionEdit", "Company", FormMethod.Post, new { @class = "nice",@style="width: 600px; height:550px;"})) { <div class="row"> <div class="columns editing-section"> @(Html.Kendo().Editor()
.Name("DescriptionEdit.CompanyDescription") .HtmlAttributes(new { style = "float: left; width: 600px; height:450px;" }) .Encode(false) .Tools(tools => tools .Clear() .Bold().Italic().Underline() .FontName() .FontSize() .InsertUnorderedList() .InsertOrderedList() ) ) </div> </div> <div class="row">
<div class="two columns"> <input type="submit" value="Save" class="nice blue radius small button middle5" /> </div> <div class="two columns"> @Html.ActionLink("Cancel", "About", "Company", new { id = Model.Company.CompanyID }, new { @class = "nice blue radius small button middle5" }) </div> <div class="eight columns"></div> </div> }}@(Html.Kendo().ListView<ViewModel>().Name("listView").HtmlAttributes(new { @class = "some-class" }))@(Html.Kendo().ListView<BusinessObject>() .Name("Equipment") .TagName("div") .ClientTemplateId("template") .DataSource(source => source.Read(read => read.Action("ControllerAction", "Controller") .Data("additionalData"))) .Pageable())<script>function additionalData() { return { first: $("#First").val(), second: $("#Second").val() };}</script>public JsonResult ControllerAction( [DataSourceRequest]DataSourceRequest request, int first, int second){ var sites = ServiceManager.SomeService .GetBusinessObjects(first, second) .ToDataSourceResult(request); var json = this.Json(sites, JsonRequestBehavior.AllowGet); return json;}I get a 404 (not found) for "Controller/ControllerAction". What am I doing wrong?
Is my whole approach valid?
The examples often show different ways of accomplishing the same thing, which is very confusing.