读书人

GridView中事件是怎么的

发布时间: 2012-01-01 23:10:55 作者: rapoo

GridView中事件是如何的?
GridView 中有ImageButton, 查看的源HTML怎麽有看到任何 __doPostBack 似的代?

[解决办法]
<input type= "image " .....>
这个自己有postback行为的
[解决办法]
在GridView 中的控件
<asp:ImageButtonID= "ImageButton1 " runat= "server " CommandArgument= "1 " CommandName= "Del "> 删除 </asp:ImageButton>
事件:
protected void dgDepartmemt_ItemCommand(object source, DataGridCommandEventArgs e)
{
string departid = e.CommandArgument.ToString();
if (e.CommandName == "Del ")
{
//要写的代码
}
}
[解决办法]
<input type= "image "> == <input type= "submit ">

如你Request[ "按扭名 "] 就会发现你只要点了哪个 哪个就会有值

读书人网 >asp.net

热点推荐