use-mvc-javascript-apis
Use ABP JavaScript APIs in MVC / Razor Pages
Call your server-side application services from browser JavaScript through ABP's JavaScript API Client Proxies instead of hand-writing $.ajax. A proxy function corresponds to the C# method — ABP drops the Async suffix and camelCases the name, DTOs are serialized to JSON, and the call returns a jQuery Deferred/Promise (with a trailing ajaxParams option), so acme.bookStore.authors.author.getList({ maxResultCount: 10 }) maps to IAuthorAppService.GetListAsync(...). This skill also covers wiring a proxy into ABP's DataTables adapter, and the rest of the client-side abp.* API surface (auth, localization, settings/features, messages, busy/block, events) that page code uses alongside the proxies.
When to Use
- You need to call an app service (
getList,get,create,update,delete, …) from page JS. - You want a server-bound data grid using
abp-table+ DataTables. - You are deciding between the runtime (dynamic) and build-time (static) proxy.
Two proxy systems
Both give the identical acme.bookStore.authors.author.get(...) calling surface; they differ in when the proxy JS is produced.
- Dynamic (default): generated at runtime. The layout automatically pulls the script from the
/Abp/ServiceProxyScriptendpoint. Easiest dev experience — nothing to regenerate when the API changes. Visit/Abp/ServiceProxyScriptin the browser to see the emitted functions. - Static: generated at development time with
abp generate-proxy -t js -u https://localhost:53929/(server must be running). Slight runtime perf gain because the API definition isn't fetched at runtime, but you must re-generate whenever the API changes. Output lands underClientProxies(e.g.app-proxy.js); import it with<abp-script src="/client-proxies/app-proxy.js"/>.