c# - What is the correct path to call a ASP.net controller method from JavaScript? -


perhaps because things in asp.net work automagically, can't seem access method in controller javascript properly. keeps saying resource not found. error message

i have js file in /scripts/wizards/wizard.js

function getsum() {     $.get("/infrastructure/base/getjsonecatalogs/");     return false; } getsum(); 

the controller trying reference basecontroller in /infrastructure/basecontroller.cs has method:

public string getjsonecatalogs()     {         // ...         return jsonstring     } 

the method returns json-formatted string need use later in javascript. don't have use $.get if not necessary, thought easiest (should use ajax?).

how can json string controller?


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -