✅ ASP.NET and jQuery + AJAX calls
the best way is to do with controllers and return a json
16 Replies
Hmm gotcha, do you mind providing an example by any chance?
https://learn.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
there is everything from controller to jquery to use it
Thank you
This is Webforms
The ancient shit
It would still be okay to do it via Webforms though right
I don't think WebAPI tutorial will help lol
LOL
you can use webapi + webform 🤔
But I don't need WebAPI.
I just need to populate this
Well, usually you call an API with JS
It hasn't changed since the days of olde when jQuery and Webforms were relevant
Excapt it used to be SOAP, now it's REST
Gotcha
Maybe there is some Webforms-specific way
@ZZZZZZZZZZZZZZZZZZZZZZZZZ So in my code-behind, would I serialize the fileNames, but how can I call it with the jQuery
Wouldn't surprise me if there was some automagical
runat=jquery
thing or someshit
I haven't used jQuery in ages, sorry
But you would... get the response from the Ajax call
Parse it somehow
And use that
To, uh, add elements with jQuery
However that worksMakes sense, I guess I'm just stuck on the calling part haha, I'll look into it more
Thanks a bunch
Oh calling the API should be easy
$.get('/the/url', response => { /* do stuff */})
if my memore serves me