Hi,
I'm writing a page with several validation controls, some of wich are only server side.
In this page I need a RequiredFieldValidation attacched to an infragistic WebDateChooser.
To display all errors at once I need to set EnableClientScript="false" on all validators so validation will occurr only on server side.
The RequiredFieldValidation works fine in "client side" mode, but if I set EnableClientScript="false" then during the server side validation this validator doesn't work.
I test RequiredFieldValidation with EnableClientScript="false" with TextBox and others controls and it work fine, but for some reason it doesn't work with WebDateChooser.
Thanks in advance for any help
Roberto
Here a sample:
code behind:
...
protected void submit(object sender, EventArgs e){ if (!Page.IsValid) return; resultLabel.Text = "done!";}
page code:
<table><tr> <th>First date:</th> <td><igsch:WebDateChooser ID="firstDateChooser" runat="server" /> <asp:RequiredFieldValidator runat="server" ControlToValidate="firstDateChooser" ErrorMessage="First date is required." Display="None" ValidationGroup="gr1" EnableClientScript="false" /> </td></tr></table><asp:ValidationSummary runat="server" ValidationGroup="gr1" EnableClientScript="false"/><asp:LinkButton runat="server" Text="Submit" OnClick="submit" ValidationGroup="gr1" /><br /><asp:Label ID="resultLabel" runat="server"></asp:Label>
I finally found a solution.
The problem is that the property signed as ValidationProperty is the Text property and the standard NullText for WebDateChooser is "Null".
Settings the NullText property at empty string resolve the problem. The RequiredFieldValidation found an empty string and display the error message.
Bye