ASP.Net 2.0 required field validator.

S

spidur1

For some reason these fields are not being validated before the
postback. Here the HTML page. Am I missing something from the
validator controls that needs to be set?


<table cellpadding="0" cellspacing="0" style="padding-top:0;
padding-bottom:0; padding-left:0; padding-right:0;" width="800">
<tr style=" background-color : #5D7B9D;">
<td colspan="2">
<asp:Label ID="Label5" runat="server"
Font-Size="Large" ForeColor="White" Text="Insert New Premium
Multiplier"
Width="432px"></asp:Label></td>
</tr>
<tr>
<td style=" width: 400px;">
<asp:Label ID="Label3" runat="server"
Font-Bold="True" Text="Description" Width="200px"></asp:Label></td>
<td style=" width: 400px;">
<asp:Label ID="Label4" runat="server"
Font-Bold="True" Text="Multi" Width="296px"></asp:Label>
</td>

</tr>
<tr>
<td style=" width: 400px; vertical-align:top;">
<asp:TextBox ID="txtDescriptionMain" runat="server"
Width="350px"></asp:TextBox><br />
<asp:RequiredFieldValidator
ID="RequiredFieldValidatorD" runat="server"
ControlToValidate="txtDescriptionMain"
ErrorMessage="Description is Required"
Display="Dynamic" ValidationGroup="Insert"
SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
<td style=" width: 400px; vertical-align:top;">
<asp:TextBox ID="txtMultiMain"
runat="server"></asp:TextBox><br />
<asp:RequiredFieldValidator
ID="RequiredFieldValidatorX" runat="server"
ControlToValidate="txtMultiMain" ErrorMessage="Please Supply a Premium
Multiplier" ValidationGroup="Insert"
Display="Dynamic"></asp:RequiredFieldValidator>
<asp:CompareValidator
ID="CompareValidatorX" runat="server" ControlToValidate="txtMultiMain"
ErrorMessage="Please Supply a Valid Integer" Operator="DataTypeCheck"
Type="Integer" ValidationGroup="Insert"
Display="Dynamic"></asp:CompareValidator>

</td>
</tr>
<tr>
<td style=" width: 400px; height: 35px;
vertical-align:bottom;">
<asp:LinkButton ID="LinkButton3" runat="server"
ValidationGroup="Insert">Insert Record</asp:LinkButton></td>
<td style=" width: 400px;">
</td>

</tr>
</table>
 
B

Bruce Barker

you forget to include a ValidationSummary control, so there is no way to
display a validation error.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top