Now let’s create a method for executing the Update or Insert. Six of those paramaters basically comes from the Text Box values that were entered in the page. Invalid Cast Exception: Unable to cast object of type 'System.
A common way to use these collections is to HTML-encode the values supplied by the user before they are stored in the data source. I write no code but it gets called) but wanted to add a confirmation of delete and that stopped working, so I used rowcommand to do the delete, it deletes the data fine, but when I rebind the grid and update the panel it does not show on the screen, if I force a refresh of the page the gridview then shows the correct date.Here is the HTML portion of the code: The the code behind for the rowcommand, it calls the objectdatasource directly using the keyfield and deletes the row then updates the grid and the updatepanel - but nothing happens, except the udpdateprogress shows for a while, showing the update event is triggered: Thanks for the reply I tried this but the page_load event is not being fired (perhaps because the grid is in an update panel) had though about setting a session variable to true when the grid is bound and then if the session variable is set to rebind in page_load, but that did not work either.The Update Panel makes creating interactive user interfaces as easy as dragging and dropping.Simply add an Update Panel to the page and, within it, add those controls that you want to participate in the partial postback.