ASP.NET HTML 控件 RequiredFieldValidator

asp.net html 控件 requiredfieldvalidator

<!doctype html>
<html>
<body>

<form runat="server">
name: <asp:textbox id="name" runat="server" />
<br>
age: <asp:textbox id="age" runat="server" />
<br><br>
<asp:button runat="server" text="submit" />
<br><br>
<asp:requiredfieldvalidator
controltovalidate="name"
text="the name field is required!"
runat="server" />
</form>

</body>
</html>
相关文章