I had this problem before. This error occurs when your control is not inDatagrid, datalist or repeater. Make sure put your control correctly.