How to call database using javascript in asp.net?
i want to fetch record from db using java script in asp.net c#
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suraj SahooRank #382 · 6.6K reputationPosted Mar 9, 2015, 8:45 AM EDT
Here you need to use ajax call to access server side action method and fetch the records.
Look at the snippet below:
$.ajax({
url:"/CONTROLLER/ACTION",
type:"GET",
success: function(response) {
//Here the response contains all the records fetched from server action
//It may be a model object, Json object, or any records required.
}
});
I hope this helps you.
Accept if this helps anyway.
Thanks