Recently i faced some strange problem with required field validator, inside a update panel its not working, since some controls are dynamically loaded with required field validattion.
But its not working properly (few buttons which has causes validation set to false also not triggering properly), then i found a solution that for any required field validation (or any validation controls), it has to load during the page load itself , so i have created a dummy text box and dummy required field validator to make sure that the validation controls emits the javascripts properly to browser.
<div style=”display:none”>
<asp:TextBox id=”txtDummy” runat=”server” Visible=”false”/>
<asp:RequiredFieldValidator ID=”reqDummy1″ runat=”server” ControlToValidate=”txtDummy” Text=”*” ValidationGroup=”DummyValgroup” ErrorMessage=”Please provide text”></asp:RequiredFieldValidator>
</div>
This helps to do the validation for dynamically created controls with validation.
I hope this may helpful for
This really helped me 🙂