hey,I am using DataList to Show Seats where booked by a ImageButton,when i click this button it change to another picture,and the item is add to cart(Grid View),if this item remove from cart,it dose not change to previous image.how can i do?please details me in C# code in ASP.NET4.


Source Code :

          RepeatColumns="4" BorderColor="#CC6600" BorderWidth="0.1em"
         GridLines="Both" DataKeyField="SeatID" onitemcommand="DataList1_ItemCommand">
     
     
        
            
            
        
        
            
            
        
        
            
            
        
        
            
        
    

                 Seat ID :

                
            

                 Seat Status :

                
            

                  

                  

                                      CommandName="Book" />
            

    

 

              ConnectionString="<%$ ConnectionStrings:ATRConString %>"
        
         SelectCommand="SELECT [SeatID], [SeatStatus] FROM [vwSeatShow] WHERE (([SCatID] = @SCatID) AND ([SeatStatus] = @SeatStatus))">
        
                              PropertyName="SelectedValue" Type="Int32" />
                              Type="String" />
        

    


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";
    }