Link to home
Start Free TrialLog in
Avatar of dotsandcoms
dotsandcoms

asked on

disable auto postback event on button submit in asp.net

Hi currently I am using asp.net 2.0 and c# language and sql server 2005 as database server

On page load event I am retrieving values from db and displaying it on form text box.
On button click event I have made database connectivity and storing value of textbox in database.
But when I am doing edition in textbox and going to save those updates. Then it will show values in textbox without modification of contents.

When I am using asp.net button it will automatically take autopostback event true.
I have read somewhere that we can disable it using html button but.......
If I am using html button then .net and sql database connectivity is not working in it.
I just want to disable autopostback event......

Thanks in advance
Avatar of coesy
coesy

But you need the postback in order to process your database stuff, the postback is what allows the onclick event of the button.
try
button.attributes.add("onClick", "return false;");)
ASKER CERTIFIED SOLUTION
Avatar of dstanley9
dstanley9

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial