This question is locked. New answers and comments are not allowed.
I'm receiving this error. Anything I'm missing?
Controller
Exception information:
Exception type: InvalidOperationException
Exception message: The view '_InsertAjaxEditing' or its master was not found. The following locations were searched:
~/Views/Admin/_InsertAjaxEditing.aspx
~/Views/Admin/_InsertAjaxEditing.ascx
~/Views/Shared/_InsertAjaxEditing.aspx
~/Views/Shared/_InsertAjaxEditing.ascx
| <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WhatsNewToDo.Web.ViewData.LocationTypeViewData> " %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
| <%= Model.SiteTitle %> - <%= Model.PageTitle %> |
| </asp:Content> |
| <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
| <h2><%= Model.PageTitle %></h2> |
| <% Html.EnableClientValidation(); %> |
| <% using (Html.BeginForm()) { %> |
| <%= Html.Telerik().Grid(Model.LocationTypeList) |
| .Name("gridLocationTypes") |
| .DataKeys(dataKeys => dataKeys.Add(lt => lt.LocationTypeId)) |
| .ToolBar(commands => commands.Insert()) |
| .DataBinding(dataBinding => |
| { |
| dataBinding.Ajax() |
| .Select("_SelectAjaxEditing", "Admin") |
| .Insert("_InsertAjaxEditing", "Admin") |
| .Update("_SaveAjaxEditing", "Admin") |
| .Delete("_DeleteAjaxEditing", "Admin"); |
| }) |
| .Columns(columns => |
| { |
| columns.Bound(lt => lt.LocationTypeName); |
| columns.Bound(lt => lt.ModifiedDate).ReadOnly(); |
| columns.Bound(lt => lt.ModifiedBy).ReadOnly(); |
| columns.Bound(lt => lt.DeletedDate).ReadOnly(); |
| columns.Bound(lt => lt.DeletedBy).ReadOnly(); |
| columns.Command(commands => |
| { |
| commands.Edit(); |
| commands.Delete(); |
| }).Width(180); |
| }) |
| %> |
| <% } %> |
| </asp:Content> |
Controller
| namespace WhatsNewToDo.Web.Controllers |
| { |
| [HandleError] |
| public class AdminController : BaseController |
| { |
| [Dependency] |
| public ILocationTypeService service { get; set; } |
| protected override void Initialize(RequestContext requestContext) |
| { |
| base.Initialize(requestContext); |
| } |
| // ************************************** |
| // URL: /Location/Create |
| // ************************************** |
| [GridAction] |
| public ActionResult LocationTypes() |
| { |
| LocationTypeViewData viewData = ViewDataFactory.CreateBaseViewData<LocationTypeViewData>("Edit Location Types"); |
| viewData.LocationTypeList = service.GetAll(); |
| return View(viewData); |
| //return View(); |
| } |
| [GridAction] |
| public ActionResult _SelectAjaxEditing() |
| { |
| LocationTypeViewData viewData = ViewDataFactory.CreateBaseViewData<LocationTypeViewData>("Edit Location Types"); |
| viewData.LocationTypeList = service.GetAll(); |
| return View(viewData); |
| } |
| [AcceptVerbs(HttpVerbs.Post)] |
| [GridAction] |
| public ActionResult _InsertAjaxEditing() |
| { |
| LocationTypeViewData viewData = ViewDataFactory.CreateBaseViewData<LocationTypeViewData>("Edit Location Types"); |
| viewData.LocationTypeList = service.GetAll(); |
| LocationType locationType = new LocationType(); |
| locationType.CreatedBy = userProfile.GetUserName(); |
| locationType.ModifiedBy = userProfile.GetUserName(); |
| if(TryValidateModel(locationType)) { |
| service.Insert(locationType); |
| } |
| //return RedirectToAction("LocationTypes"); |
| return View(viewData); |
| } |
| [HttpPost] |
| [GridAction] |
| public ActionResult _SaveAjaxEditing(Guid locationTypeId) |
| { |
| return View(new GridModel(service.GetAll())); |
| } |
| [HttpPost] |
| public ActionResult _DeleteAjaxEditing(Guid locationTypeId) |
| { |
| return View(new GridModel(service.GetAll())); |
| } |
| } |
| } |