V
Vincent
Hi,
i created a detailsview in insert mode. In order to avoid that an user
inserts nothing, i added a RequiredFieldValidator control.
But i get this error:
"Control 'DetailsView1' referenced by the ControlToValidate property of
'RequiredFieldValidator1' cannot be validated"
Why and how to avoid wrong (empty) input?
Thanks
Vincent
<aspetailsView ID="DetailsView1" runat="server" DefaultMode="Insert">
<Fields>
<asp:BoundField DataField="groepnr" HeaderText="groepnr"
InsertVisible="False"
ReadOnly="True" SortExpression="groepnr" />
<asp:BoundField DataField="groepna" HeaderText="groepna"
SortExpression="groepna" />
<asp:BoundField DataField="kleur" HeaderText="kleur"
SortExpression="kleur" />
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True"
ShowInsertButton="True" />
</Fields>
</aspetailsView>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="DetailsView1"></asp:RequiredFieldValidator>
i created a detailsview in insert mode. In order to avoid that an user
inserts nothing, i added a RequiredFieldValidator control.
But i get this error:
"Control 'DetailsView1' referenced by the ControlToValidate property of
'RequiredFieldValidator1' cannot be validated"
Why and how to avoid wrong (empty) input?
Thanks
Vincent
<aspetailsView ID="DetailsView1" runat="server" DefaultMode="Insert">
<Fields>
<asp:BoundField DataField="groepnr" HeaderText="groepnr"
InsertVisible="False"
ReadOnly="True" SortExpression="groepnr" />
<asp:BoundField DataField="groepna" HeaderText="groepna"
SortExpression="groepna" />
<asp:BoundField DataField="kleur" HeaderText="kleur"
SortExpression="kleur" />
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True"
ShowInsertButton="True" />
</Fields>
</aspetailsView>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="DetailsView1"></asp:RequiredFieldValidator>