PDA

View Full Version : سوال: مشکل با هندل کردن RowDeleting بعد از حذف به روش دستی



hamparvaz
چهارشنبه 10 مهر 1387, 21:49 عصر
سلام:قلب:
من با یک دکمه روی گرید که گذاشتم حذف رو با کد زیر و تنظیم کردن CommandName و CommandArgument به روش دستی انجام میده.


protected void GridUserInfo_RowCommand(object sender, GridViewCommandEventArgs e)
{

if (e.CommandName == "Delete")
{
string DelStr = "DELETE FROM USERS WHERE UID = '" + e.CommandArgument + "'";
DBAccess_Class DBA = new DBAccess_Class();

SqlCommand CMD = new SqlCommand(DelStr.ToString());


CMD.CommandType = CommandType.Text;

DBA.ExecNonQuery(CMD);
GridDataBind();
}

}

کد درست کار میکنه (یعنی از داخل DB حذف میکنه)
اما به من میگه RowDeleting رو هندل نکردم. با پیغام زیر.:افسرده:


Exception Details: System.Web.HttpException: The GridView 'GridUserInfo' fired event RowDeleting which wasn't handled.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


اگر نهوه هندل کردن رو به من بگید ممنون میشم.

kezack
چهارشنبه 10 مهر 1387, 22:07 عصر
در Grid رو قسمت RowDeleting دابل كليك كن تا مشكلت حل شه