LinkButton in a DataList
- by erasmus
I have a datalist and in its header template I have a linkbutton.In my codebehind file I wrote as I've always written:
((LinkButton)(DataList1.FindControl("LinkButton1"))).Enabled = false;
but this gives me the error:
Object reference not set to an instance of an object.
How can I access this linkbutton?