Last post Oct 18, 2007 02:54 AM by elkdanger
Oct 17, 2007 11:05 PM|ethan_seahz|LINK
hi guys, i am also trying required field validator that i dragged out from the toolbar. but
Control 'RequiredFieldValidator1' of type 'RequiredFieldValidator' must be placed inside a form tag with runat=server.
how do i solve this? i have dragged the summary out too.
Oct 18, 2007 01:59 AM|elkdanger|LINK
It's just like the error says, really. It needs to be placed inside a form tag, where the form has the attribute "runat='server'", like so:
<form id="form1" runat="server">
<asp:Textbox runat="server" id="txtExample" />
<asp:CustomValidator runat="server" id="cuvExampleValidator" ErrorMessage="Huzzah!" OnServerValidate="SomeValidationFunction"/>
The summary control would also need to go inside the form tag in the same way.
Hope that helps.
Oct 18, 2007 02:19 AM|ethan_seahz|LINK
hey thanks for the help man.
its so unexpected because i thought they normally fall into place.
Oct 18, 2007 02:54 AM|elkdanger|LINK
Yeah, .Net page controls usually have to be placed inside a managed form tag, for Viewstate and other such things.
Glad I could help :-)