Last post Mar 01, 2018 08:49 AM by Eric Du
Feb 26, 2018 10:25 PM|gunderj|LINK
For my MVC application I have been using ajax calls to the Contoller to call databse stored procedures. My MVC appliation also uses a simple html file which I want to add an ajax call to. Is it possible and How can I do this without a Controller class?
Feb 27, 2018 06:19 AM|Eric Du|LINK
According to your description, as far as i know and i make a test, we can not call method without controller in MVC, we usually put the method in the controller, then call it directly.
Could you tell us what is your actual needs and why not use the regular method to call method?
Feb 27, 2018 07:07 PM|gunderj|LINK
Here is my actual need - my web app has several MVC pages, each with razor page and the two classes for Model and Controller. In the front of this app is index.html which is not MVC, ie., no razor or Model or Controller classes. I want to add ajax call
Mar 01, 2018 08:49 AM|Eric Du|LINK
According to your description, you want to get the data through the AJAX call in html page, i think you could call controller action from the html page Ajax directly, it could return data. view doesn't need corresponding controller, model. i have test it
in my side, it works.
if my understanding isn't right, please correct me!