关于AfterEditor事件为什么后台没有响应呢?就是在前端表格的单元格中修改了数据,想把它更新到数据库里面去
下面是我的部分代码:
前端:
<plugins>
<ext:RowEditor ID="RowEditor1" runat="server" SaveText="Update">
<DirectEvents>
<AfterEdit OnEvent="OnAfterEdit">
<ExtraParams>
<ext:Parameter Name="ColleageNumber" Value="e.record.get('ColleageNumber')" Mode="Raw"/>
<ext:Parameter Name="Name" Value="e.record.get('Name')" Mode="Raw" />
<ext:Parameter Name="Sex" Value="e.record.get('Sex')" Mode="Raw" />
<ext:Parameter Name="Major" Value="e.record.get('Major')" Mode="Raw" />
</ExtraParams>
</AfterEdit>
</DirectEvents>
</ext:RowEditor>
</plugins>
后端:
protected void OnAfterEdit(object sender, DirectEventArgs e)
{
string ColleageNumber = e.ExtraParams["ColleageNumber"];
string Name = e.ExtraParams["Name"];
string Sex = e.ExtraParams["Sex"];
string Major = e.ExtraParams["Major"];
string UpdateSql = "update xx set Name='" + Name + "',set Major='" + Major + "',set Sex='" + Sex + "' where ColleageNumber='" + ColleageNumber + "'";
SqlHelper.ExecuteNonQuery(ConnectStr, CommandType.Text, UpdateSql);
X.Js.Alert(Name);
}
不懂为何没有响应,在这里加了个断点但是没有命中 string ColleageNumber = e.ExtraParams["ColleageNumber"];
该怎么做呢