Unfortunately i have to set enableclientscript="False" because of Ajax problem. So now, how may i handle the validation? The validation wont work anymore...
My code:
<asp:ValidationSummary ID="ValidationSummary1" HeaderText="Please correct the following:" ShowMessageBox="true" ShowSummary="false" runat="server" EnableClientScript="False"/>
<asp:TextBox ID="txtNewLocationName" runat="server" MaxLength="50" />
<asp:RequiredFieldValidator runat="server" ID="rfvNewLocationName" Display="None"
ControlToValidate="txtNewLocationName" ErrorMessage="Location Name is required." />
The EnableClientScript property is for a client side validation. The control itself uses server side validation so it sounds like it is working how it should. If you have a textbox that is optional then I would remove that RequiredFieldValidator. No point
in mandating a field is to be filled out if it is optional.
Validation controls always perform validation on the server. They also have complete client-side implementation that allows DHTML-supported browsers (such as Microsoft Internet Explorer 4.0 and later) to perform validation on the client. Client-side validation
enhances the validation process by checking user input before it is sent to the server. This allows errors to be detected on the client before the form is submitted, avoiding the round trip of information necessary for server-side validation.
Chetan Sarode
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
seiko88
Member
41 Points
91 Posts
Manage Required Field Validator with enableclientscript="False"
Apr 30, 2012 03:32 PM|LINK
Unfortunately i have to set enableclientscript="False" because of Ajax problem. So now, how may i handle the validation? The validation wont work anymore...
My code:
<asp:ValidationSummary ID="ValidationSummary1" HeaderText="Please correct the following:" ShowMessageBox="true" ShowSummary="false" runat="server" EnableClientScript="False"/>
<asp:TextBox ID="txtNewLocationName" runat="server" MaxLength="50" />
<asp:RequiredFieldValidator runat="server" ID="rfvNewLocationName" Display="None"
ControlToValidate="txtNewLocationName" ErrorMessage="Location Name is required." />
chaaraan
Contributor
2170 Points
484 Posts
Re: Manage Required Field Validator with enableclientscript="False"
Apr 30, 2012 05:38 PM|LINK
hi ,
you will be submitting the entered text values in some button event
check if the textbox value is greater than 0 in that event
else throw error message
Location is required
Regards,
Charan
chetan.sarod...
All-Star
65619 Points
11118 Posts
Re: Manage Required Field Validator with enableclientscript="False"
May 01, 2012 05:14 AM|LINK
The EnableClientScript property is for a client side validation. The control itself uses server side validation so it sounds like it is working how it should. If you have a textbox that is optional then I would remove that RequiredFieldValidator. No point in mandating a field is to be filled out if it is optional.
Validation controls always perform validation on the server. They also have complete client-side implementation that allows DHTML-supported browsers (such as Microsoft Internet Explorer 4.0 and later) to perform validation on the client. Client-side validation enhances the validation process by checking user input before it is sent to the server. This allows errors to be detected on the client before the form is submitted, avoiding the round trip of information necessary for server-side validation.
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
seiko88
Member
41 Points
91 Posts
Re: Manage Required Field Validator with enableclientscript="False"
May 02, 2012 01:31 PM|LINK
I could not figure out how to show my messages in message box but it worked to write the error messages near wrong content.