In UserControl how to set ControlToValidate Property of Validator to a control in parent page textbox

572 views Asked by At

I am getting this error below

** Unable to find control id 'ctl00$ContentPlaceHolder1$gvExpense$ctl03$lblIncTotalAmt' referenced by the 'ControlToValidate' property of 'cmpAmountAdj'**

Here CompareValidator "cmpAmountAdj" is inside gridviewrow strGridControlToValidate is Id of gridview of parent page strControlToValidate is Id of textbox inside footer of parent gridview

 ((CompareValidator)e.Row.FindControl("cmpAmountAdj"))
.ControlToValidate = ((Label)(GridView)this.Parent
.FindControl(strGridControlToValidate)).FooterRow
.FindControl(strControlToValidate)).UniqueID;

Please Suggest...

0

There are 0 answers