ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Awesome Controllers on Areas
Title:
B
I
{code}
?
I have Admin Area in my MVC project, for controller this is namespace [MyProject].Web.Areas.Admin.Controllers this is the registration public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new {action = "Index", id = UrlParameter.Optional}, new[] {"[MyProject].Web.Areas.Admin.Controllers"}); } but if i use a awesome grid ... namespace [MyProject].Web.Areas.Admin.Controllers.Awesome { public partial class LocaleStringResourceGridController : Controller { private readonly MyProjectDatabase db; public LocaleStringResourceGridController([MyProject]Database db) { this.db = db; } public virtual ActionResult GetItems(GridParams g, string search) { var list = db.LocaleStringResources.Where(o => o.IsDeleted == false); list = list.OrderBy(o => o.ResourceName); return Json(new GridModelBuilder<LocaleStringResource>(list.AsQueryable(), g) { Map = LocaleStringResource => new { LocaleStringResource.Id, LocaleStringResource.ResourceName, LocaleStringResource.ResourceValue, Actions = this.RenderView("Actions/ShowEditGridActions", new [MyProject].Web.ViewModels.ActionBtn { Id = LocaleStringResource.Id, IsDeleted = LocaleStringResource.IsDeleted, Controller = "LocaleStringResource" }) } }.Build()); } } } this error occour ... message="The controller for path '/Admin/LocaleStringResourceGrid/GetItems' was not found or does not implement IController." Have any idea ?
Save Changes
Cancel
mtugnoli
asked at 11 Jun 2014
can't see anything wrong you could simplify the problem by returning a simple string in the GetItems action and running the action directly in the browser btw why do you need the partial ? looks like the class is made just for the grid
at 11 Jun 2014
Omu
the grid hits the url that you set in .Url just like your browser would
at 11 Jun 2014
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK