5
這是我在stackoverflow.com的第一個問題。asp:RequiredFieldValidator和單選按鈕
我正在學校項目,我必須驗證用戶的輸入。每次頁面加載時,都會給服務器提供錯誤信息。請參閱代碼以及之後的錯誤消息。
<div>
<table>
<td>
<asp:RadioButton ID="RadioButton1" runat="server"></asp:RadioButton>
<asp:RequiredFieldValidator ID="validateCheck" runat="server" ControlToValidate="RadioButton1" ErrorMessage="Please Enter" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</table>
</div>
Server Error in '/' Application.
Control 'RadioButton1' referenced by the ControlToValidate property of 'validateCheck' cannot be validated.