|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView RowComand event IssueIn the footer of the gridview, I have a dropdown and a "Add" button set up,
so I can add new rows to the gridview. The "Add" button has CommandName of "ADD", so I use that in the GridView1_RowCommand to check if (e.CommandName == "ADD") before I add the row. Everything works fine except, after adding a row, then I hit the refresh button in the browser, another row got added because the commandname in the RowCommand Event is still "ADD". hai J li..
wats ur problem tell me exactly Li.. u need to refresh the page when add is clicked or ? J Li wrote: Show quoteHide quote > In the footer of the gridview, I have a dropdown and a "Add" button set up, > so I can add new rows to the gridview. The "Add" button has CommandName of > "ADD", so I use that in the GridView1_RowCommand to check if (e.CommandName > == "ADD") before I add the row. > > Everything works fine except, after adding a row, then I hit the refresh > button in the browser, another row got added because the commandname in the > RowCommand Event is still "ADD". J Li wrote:
> In the footer of the gridview, I have a dropdown and a "Add" button set up, What kind of browser are you using? You should get a warning you are> so I can add new rows to the gridview. The "Add" button has CommandName of > "ADD", so I use that in the GridView1_RowCommand to check if (e.CommandName > == "ADD") before I add the row. > > Everything works fine except, after adding a row, then I hit the refresh > button in the browser, another row got added because the commandname in the > RowCommand Event is still "ADD". doing a post request in most browsers. For a work around you could set your rowcommand to an other string after the execution of the method. This will be kind of: if (e.CommandName == "ADD") { // your code } e.CommandName = "Cancel";
Display an empty grid
good sample of creating my own web control? implicit vs explicit localization AccessDataSource - how to get access to the retrieved data? changing rows in a multiline textbox localization for all MS web controls email sending twice Trigger an Insert on a FormView control GridView row selection with client side script Request for the permission of type System.Web.AspNetHostingPermission failed |
|||||||||||||||||||||||