How to call database using javascript in asp.net?
i want to fetch record from db using java script in asp.net c#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suraj SahooPosted Mar 9, 2015, 12:45 PM
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