Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.70/5 (3 votes)
See more:
I have multiple Buttons on one page whenever i click on button page Refresh... How can i stop this ? i dont want that page refresh on button click... i am using Asp.net C#..

Please Help.....
Posted
Comments
Kornfeld Eliyahu Peter 7-Sep-14 5:08am    
Learn about AJAX...
Raul Iloc 8-Sep-14 1:40am    
Did you try one of the options suggested in my solution?
Member 11014751 8-Sep-14 4:37am    
I tried this
http://ajax.net-tutorials.com/controls/updatepanel-control/

but not working in my project
Member 11014751 8-Sep-14 4:37am    
i am developing on framework 2.0
Member 11014751 8-Sep-14 4:43am    
My problem is not Solved :(

1 solution

1.By default each button generate a postback of the page to the web server, and as result the page content is send to the web server, the page events are executed and at the end the page is sent back in HTML format to the browser and the browser render the page.

2.To avoid the entire page postback you have more options:
i)set AutoPostBack attribute on false and use JavaScript and AJAX call associated with the OnClick event; For details about using jQuery and AJAX call in ASP.NET see: Calling a C# method using jQuery on the client side[^]
OR
ii)use UpdatePanelso only the area of the used panel will be refreshed and not the entire page. See details about update panel: http://msdn.microsoft.com/en-us/library/vstudio/bb399001(v=vs.100).aspx[^]
 
Share this answer
 
v2

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