I have a website where the user requires to add and remove Headlines from the main page. The headlines are stored in a database with a column titled ‘Display’ (true or false) which decides if the headlines appear. I want the user to have the ability to add or remove headlines from the main page, so have created another page which creates a table of all headlines along with a drop down list containing ‘Enable’ and ‘disable’. I want these drop down lists to work by when the user changes the value in the drop down list the database will be updated. Only I cant find how to give the drop down lists an on change event.
Any ideas? Am I going about this the right way or is there a better way to do this?
First, to do your actual request You would set the dropdowns to autopostback, and add a handler to get the value and update the data, IE (although at minimum your dropdowns would be in a repeater, or datagrid)
An easier way, if you are accessing SQL directly is to use a datagrid and databind it to your SQL query.