Source Code :
GridLines="Both" DataKeyField="SeatID" onitemcommand="DataList1_ItemCommand">
Seat ID : | |
Seat Status : | |
SelectCommand="SELECT [SeatID], [SeatStatus] FROM [vwSeatShow] WHERE (([SCatID] = @SCatID) AND ([SeatStatus] = @SeatStatus))">
C Sharp Code :
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Book")
{
Label lblId = (Label)DataList1.Items[e.Item.ItemIndex].FindControl("lblSID");
Label1.Text = lblId.Text;
btn = (ImageButton)DataList1.Items[e.Item.ItemIndex].FindControl("BtnBook");
btn.ImageUrl = "~/Icons/Cros.jpg";
AddSeatToCart();
gvCart.DataSource = dt;
gvCart.DataBind();
}
}
protected void gvCart_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
dt.Rows.RemoveAt(e.RowIndex);
gvCart.DataBind();
//btn = (ImageButton)DataList1.FindControl("BtnBook");
//btn.ImageUrl = "~/Icons/Tick.jpg";
}
Replies
Know the answer? Post it — somebody with the same question will find it here.