Click here to Skip to main content
15,905,420 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to insert/select/delete in asp.net using c# and sql server without refresh the hole page.
Posted

For that you have to use jQuery Ajax enabled page.

$.ajax({ 
            url: 'http://localhost:60792/api/student/', 
            type: 'POST', 
            data: JSON.stringify(student), 
            contentType: "application/json;charset=utf-8", 
            success: function (data) { 
                alert('Student added Successfully'); 
            }, 
            error: function () { 
                alert('Student not Added'); 
            } 
        });


For more info check this : jQuery.ajax()

I hope this will help to you.
 
Share this answer
 
Use AJAX[^] or jQuery[^]
 
Share this answer
 
if you are not using javascript ajax then you can use ASP.NET Update Panel
 
Share this answer
 
Comments
Abhilask kumar 29-Oct-13 1:49am    
I have already use update panel but after click on button then page go on loading.
the best option for this is using Ajax update panel .put your all control inside the panel and load it .
 
Share this answer
 
Comments
Abhilask kumar 29-Oct-13 1:57am    
Thanks

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