代码:
<!DOCTYPE html><html>
<body>
<form runat="server">
<table>
<tr>
<td>
<table bgcolor="#b0c4de" cellspacing="10">
<tr>
<td align="right">Name:</td>
<td><asp:TextBox id="txt_name" runat="server"/></td>
<td>
<asp:RequiredFieldValidator
ControlToValidate="txt_name"
ErrorMessage="Name"
Text="*"
runat="server"/>
</td>
</tr>
<tr>
<td align="right">Card Type:</td>
<td>
<asp:RadioButtonList id="rlist_type"
RepeatLayout="Flow"
runat="server">
<asp:ListItem>Diners</asp:ListItem>
<asp:ListItem>MasterCard</asp:ListItem>
<asp:ListItem>Visa</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<asp:RequiredFieldValidator
ControlToValidate="rlist_type"
ErrorMessage="Card Type"
InitialValue=""
Text="*"
runat="server"/>
</td>
</tr>
<tr>
<td></td>
<td><asp:Button id="b1" Text="Submit" runat="server"/></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<asp:ValidationSummary
ShowMessageBox="true"
ShowSummary="false"
HeaderText="You must enter a value in the following fields:"
EnableClientScript="true"
runat="server"/>
</form>
</body>
</html>
结果:
- ASP.NET Web Pages Database 参考手册
- ASP.NET Web 表单
- ASP.NET Repeater 控件
- ASP.NET Web 服务器控件
- ASP.NET CheckBox 控件
- WebSecurity CreateUserAndAccount 方法
- HTML InputImage
- HTML Table
- ASP.NET HTML 控件 Button 2
- ASP.NET HTML 控件 CheckboxList
- Textbox 3
- ASP.NET HTML 控件 Hashtable RadiobuttonList 2
- ASP.NET HTML 控件 Hashtable DropDownList
- ASP.NET BorderColor 属性
- ASP.NET CssClass 属性
- ASP.NET Image ImageUrl 属性
- ASP.NET TextBox Columns 属性
- 取得列数
- 文件何时被创建
- comparevalidator