Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Dear Sir,
please explain how to stop page refresh on button click event, or dropdownlist selected index changed
Posted
Comments
Nandakishore G N 27-Nov-13 1:36am    
to stop postback for button add onclientclick="return false;" and for dropdown remove autopostback=true property or set it to false
Tom Marvolo Riddle 27-Nov-13 1:55am    
Atleast tag the question as ASP.Net
aiswarjya 27-Nov-13 1:56am    
if i set auotpostback=false for dropdownlist selectedindexchanged. then how to fire this event
Tom Marvolo Riddle 27-Nov-13 1:59am    
post your code .It will be easy for us to understand the logic

Both the Events postback the data from client to the server.That's why the page get refreshed.
Use Updatepanel to avoid this.
Check these links to know more about this:
http://msdn.microsoft.com/en-us/library/aa720471%28v=vs.71%29.aspx[^]
http://msdn.microsoft.com/en-us/library/ms178472.ASPX[^]
 
Share this answer
 
v2
For button or dropdownlist set its AutoPostBack property to false if you are using client side events.

if you are writing server side events then you can use an update panel.
 
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