I've got an issue where i've got a number of controls inside an UltraWebTab control.
Players:
Scenario:
Amidst the multiple tabs there are controls which need to be validated upon postback. I had initially put the respective validators within the tabs that the controls to validate were located, however without an easy way to alert the user that specific tabs had invalid data, I opted to put the validators outside the UltraWebTab, where the user would be able to see all of the problems without clicking through each tab.
However, when I move the validators outside the webtab, the page won't load because the ControlToValidate cannot be found on the page. Any ideas?
Workaround / Solution:
Because the failure was happening OnPreRender, i took the design-time configuration out of the RequiredFieldValidator, and in the overrided OnPreRender() method (for the page), added the UniqueID of the control to the ControlToValidate property of the RFV...
229
230 protected override void OnPreRender(EventArgs e)
231 {
232 this.reqBuild.ControlToValidate = this.txtBuild.UniqueID;
233
234 base.OnPreRender(e);
That did not work for me!!!
I have a UltrawebTab in a user control, when I ty using this code I'm still having the same issue.
Unable to find control id 'ctl00$PagePlaceHolder$TempEmployeeDetailViewControl$UltraWebTab1$ctl00$FirstNameTextBox' referenced by the 'ControlToValidate' property of 'FirstNameRequiredFieldValidator'.
I'm lost now!!! I can not make it work.
Regards