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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -