Information Management for an ASP.NET AJAX Server-Centric Based Online Shopping Website - Deleting Left Words
(Page 4 of 4 )
Deleting the Left Words
When clicking the "X" button on the grid control the associated row will be deleted, as is shown through the listed code below:
protected void LeavewordView_RowCommand(object sender,GridViewCommandEventArgs e){
if(e.CommandName == "delete") {
///delete data
Leaveword word = new Leaveword();
word.DeleteLeaveword(Int32.Parse(e.CommandArgument.ToString()));
///rebind data to the control
BindLeavewordData();
Response.Write("<script>alert('" + "Deleting successfully. Please safekeep your data!" + "');</script>");
}
}
Here we see a list of the typical GridView control operation. First find the "delete" command through the CommandName attributeof the GridViewCommandEventArgs parameter. Next, with the help of the member function named DeleteLeavewordof the Leaveword class,the selected left word is finally removed from the database. At last, refresh the grid control by invoking the BindLeavewordData help method. That's it.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |