Taking action without redirecting
3 answers
You want to have a view that returns nothing. No viewing. No nadda?
If so, u can return EmptyResult class ViewResult ...
NTN.
0
a source to share
You can call it a technique Reflection
, but it is not recommended . Soon, because it's not in the request / response / controller context.
Personally, I prefer to have internal static method(bla bla){...}
and name it wherever I want.
But if you let go
without instantiating this controller
... Then you can use this methodology . But as explained, It Is Not Recommended Too . summarizes the following:
var controller = new FooController();
controller.ControllerContext = new ControllerContext(this.ControllerContext.RequestContext, controller);
var jsonResult = controller.BlaMethod(someInputParams);
0
a source to share