c# - How do I call a method from another controller? -
i have couple of reusable methods getchartdata() , getpeopledata(). stored in controller called centraldata.cs
i able call 1 of these methods different controller i'm not sure how that. know how call method located in controller?
if method in same class simple as:
mymethod() { getchartdata(); }
so if method in different controller , sucha different class, how call it?
you can create object of controller
, call function simple class. not think problems approach. after all, controller class. e.g.,
mycontroller obj = new mycontroller(); obj.myfunction();
Comments
Post a Comment