I am trying to compare two buttons in ItemDataBound, one button is inside the
FooterTemplete and the other inside the ItemTemplate but getting this error
message: 'btnServiceReturn' conflicts with the declaration
'intranet.ComputerServices.Private.IMS.laptop_deta ils.btnServiceReturn'
what am i doing wrong? here is the code.. many thanks
public void rptService_ItemDataBound(object s, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
Button btnServiceBook =
(Button)e.Item.FindControl("btnServiceBook");
}
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
Button btnServiceReturn = (Button)e.Item.FindControl("btnServiceReturn");
}
if(btnServiceReturn.Visible == true)
{
btnServiceBook.Visible = false;
}
}