2011-09-08 69 views
2

我正在开发一个电影院的座位预订网站。我已经使用ImageButton将图像放置为Seatsasp:gridview(all cells)中。对于选定的座位,当用户点击它时,ImageButton(cell)为该座位设置。如何在ASP.Net中动态点击单元格时获取gridview单元格的值

我需要获得从gridview点击的座位。我怎么能做到这一点?

+0

做jQuery是确定在这里? –

回答

0

您可以在网格视图的RowCommand事件中找到ImageButton。

部分代码:

string strType=""; 
ImageButton img = (ImageButton)e.CommandSource; 
strType = img.Attributes["TypeID"].ToString(); 

设计部分:

<asp:ImageButton ID="imgBtn" runat="server" ImageUrl="image" 
TypeID="..Give your value.." /> 
相关问题