AJAX in ASP.NET - How do I check a checkbox and have the action reflected in the database?
Posted
by hamlin11
on Stack Overflow
See other posts from Stack Overflow
or by hamlin11
Published on 2010-04-15T17:08:41Z
Indexed on
2010/04/15
17:13 UTC
Read the original article
Hit count: 161
This is about as beginner as it gets regarding AJAX, but here it goes.
I want to have one checkbox somewhere on an ASP.NET web form (ASPX).
When the user clicks the checkbox, I want one of those spinning indicators to show.
While that spinning indicator is showing, I want an update operation to occur in the database to reflect that the user has intended for that checkbox to be checked.
update MyTable set CheckboxChecked = 1
Then, as soon as the update operation has occurred, I want that to be reflected in the checkbox by removing the spinning indicator and replacing it with the standard checked checkbox.
I'm guessing this is done with an UpdatePanel and possibly an update statement followed by a looped call to a select statement... but I have never used AJAX before and have no idea how to go about it.
Thanks!
© Stack Overflow or respective owner