c# - ControlToValidate doesn't work -
i'm trying add requiredfieldvalidator behind <input>
.
the following code:
<form id="form1" runat="server"> <div> <input type="text" id="mid" /> <asp:requiredfieldvalidator id="requiredfieldvalidator1" runat="server" errormessage="requiredfieldvalidator"></asp:requiredfieldvalidator> <br /> </div> </form>
then, i'm trying assign controltovalidate mid, id of input text. however, there isn't available in controltovalidate:
then, type mid in , run program,
<form id="form1" runat="server"> <div> <input type="text" id="mid" /> <asp:requiredfieldvalidator id="requiredfieldvalidator1" runat="server" errormessage="requiredfieldvalidator" controltovalidate="mid"></asp:requiredfieldvalidator> <br /> </div> </form>
it's been 5 or 6 years since last wrote asp.net website, i'm sure can use server side validators on server side input controls. form doesn't contain server side input controls.
<input type="text" id="mid" />
should asp:textbox
tag.
wiki
Comments
Post a Comment