Add onclick event to command field in asp.net DetailsView

Hli4S

New Member
I have this \[code\]command field\[/code\] in \[code\]DetailsView\[/code\].\[code\]<asp:CommandField ShowInsertButton="True" CancelText="Reset" />\[/code\]When user click this link, its insert the user filled data in \[code\]DetailsView\[/code\] into database. but i want to set text to two text boxes in this \[code\]DetailsView\[/code\] before inserting. i can do it in code behind. i have tried this by adding \[code\]OnItemInserting\[/code\] event to \[code\]DetailsView\[/code\]. but its not worked. data set in code behind not inserted to database.code behind\[code\]protected void ABC_DV_ItemInserting(Object sender, DetailsViewInsertEventArgs e) { TextBox p = (TextBox)LKArea_DV.FindControl("txt_p"); TextBox x= (TextBox)ABC_DV.FindControl("txt_x"); TextBox y= (TextBox)ABC_DV.FindControl("txt_y"); string[] q = p.Text.Trim().Split(','); x.Text = q[0]; y.Text = q[1]; }\[/code\]How could i do this ?
 
Back
Top