I prefer all that relates with something are concentrated in one place, so I wanted to make a controller with hijacked route for my page.
Here is some code:
public class BlogPageController : RenderMvcController // Hijacked!
{
public override ActionResult Index(RenderModel model)
{
return base.Index(model);
}
// I want use this somehow
public JsonResult Some(SomeModel model)
{
return Json(model, JsonRequestBehavior.AllowGet); // do some stuff
}
}
public class SomeModel
{
public string one { get; set; }
public string another { get; set; }
}
I want to make some query to url like /blog and a make a request like /blog/some?one=1&another=2
I think that method in RenderMvcController it means Template,
you can change the template in back-office or browse to the alternative template /blog?alternativeTemplate=Some
Using additional methods in a hijacked controller
Hello.
I prefer all that relates with something are concentrated in one place, so I wanted to make a controller with hijacked route for my page.
Here is some code:
I want to make some query to url like
/blog
and a make a request like/blog/some?one=1&another=2
How to request Some(SomeModel) method?
Or any other way to make a concentrated logic?
I think that method in RenderMvcController it means Template, you can change the template in back-office or browse to the alternative template /blog?alternativeTemplate=Some
is working on a reply...