Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my project I need to use JSON and AJAX with the help of web method. I am using ASP controls instead of html. I have a submit button click on my project. But here I use normal server side controls to save data to SQL Server database. But due to that the page refreshes. So I need to use client side codes instead of server side code. Please help me the details of usage of all the 3 things: web methods, JSON and AJAX to avoid page reload.

1 solution

If you do not want complete page refreshes then you can wrap your controls in an Update Panel. Alternatively, the better way is to create basic html controls and then make Web Service or Web Api calls to execute server side code. The service/api can return data in the form of JSON which can be used as per your needs. This is just an overview of how you should proceed, for more details you can refer to the following, or you should google for a variety of questons.[^][^]

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900