Hello,
I am working in c# asp.net
can i use AJAX for crud operations with c# asp.net code, not mvc.
Mine code is working, but without ajax performance is very slow some times..
Any sample code would be appericiated !!
Hello,
I am working in c# asp.net
can i use AJAX for crud operations with c# asp.net code, not mvc.
Mine code is working, but without ajax performance is very slow some times..
Any sample code would be appericiated !!
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.
Sandhiya PriyaPosted Oct 13, 2025, 6:59 AM
Yes! You can absolutely use AJAX for CRUD operations in ASP.NET Web Forms (C#) without using MVC.
Using AJAX avoids full-page postbacks, which improves performance significantly. Here’s a clear explanation with a simple example.
1. Using AJAX in ASP.NET Web Forms
You have two main approaches:
a. Using
PageMethodsCreate static methods in your code-behind.
Call them from JavaScript via AJAX.
Code-Behind (C#)
ASPX Page (JavaScript)
Notes:
Methods must be
[WebMethod]andstatic.Data is passed as JSON.
No full-page refresh → faster CRUD.
b. Using
UpdatePanel(Partial Postback)For simpler scenarios, you can wrap controls in an
UpdatePanel.Only the panel refreshes, not the whole page.
3. Benefits of Using AJAX
No full-page reload → faster.
Better user experience.
Can return JSON for easy rendering in JavaScript.
Prasad RaveendranPosted Sep 20, 2025, 4:58 AM
I second Sam Hobbs comments. What exactly you are trying to achieve.
If you’re staying on Web Forms, use
[WebMethod](PageMethods) or.asmxservices.If you can, consider migrating to Web API (even in Web Forms) for modern REST-style CRUD with AJAX
Option 1 – Using
PageMethodswith Web Formscode behind
Option 2 – Using a Web Service (
.asmx)You can create a lightweight Web Service and call it via AJAX.
Then call it with AJAX:
Sam HobbsPosted Sep 19, 2025, 9:28 PM
CRUD implies database. Databases are typically in a server, rarely in the client. AJAX is primarily a client-side technology.
Are you asking if it is possible to use AJAX in the client to make requests to a database in the server?