2011-09-08 14 views
2

나는 영화 극장 좌석 예약 웹 사이트를 개발 중입니다. 나는 Seatsasp:gridview(all cells)에 넣고 ImageButton을 사용했다. 선택한 시트에 대해 사용자가 클릭하면 해당 시트에 ImageButton(cell)이 설정됩니다.ASP.Net에서 셀을 동적으로 클릭하면 gridview 셀 값을 얻는 방법

gridview에서 클릭 한 자리를 가져와야합니다. 내가 어떻게 할 수 있니?

+0

jQuery를 여기 괜찮합니까? –

답변

0

ImageButton은 눈금보기의 RowCommand 이벤트에서 찾을 수 있습니다.

코드 부분 :

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

디자이너 부분 :

<asp:ImageButton ID="imgBtn" runat="server" ImageUrl="image" 
TypeID="..Give your value.." /> 
관련 문제