Answer the question
In order to leave comments, you need to log in
Validating form fields in ASP.NET?
good afternoon.
there is a form like this:
<h3>Обратная связь</h3>
<table>
<tr style="display:none;">
<td></td>
<td><asp:TextBox size="30" runat="server" ID="SubjectTextBox" Width="132px" style="padding: 2px; margin: 0; border: 1px solid gray" /></td>
</tr>
<tr>
<td>Тема:</td>
<td valign="top"><asp:TextBox size="30" runat="server" ID="TopicTextBox" Width="132px" style="padding: 2px; margin: 0; border: 1px solid gray" /></td>
</tr>
<tr>
<td>Е-mail:</td>
<td valign="top" ><asp:TextBox size="30" runat="server" ID="ЕmailTextBox" Width="132px" style="padding: 2px; margin: 0; border: 1px solid gray"/></td>
</tr>
<tr>
<td>Текст сообщения:</td>
<td valign="top" >
<asp:TextBox Rows="10" runat="server" ID="MessageTextBox" Columns="50" TextMode="MultiLine" Width="132px" style="padding: 2px; margin: 0; border: 1px solid gray"/>
</td>
</tr>
<tr>
<td valign="top"></td>
<td valign="top"><asp:Button runat="server" ID="SendButton" Text="Отправить" OnClick="SendButton_Click" /></td>
</tr>
</table>
Answer the question
In order to leave comments, you need to log in
figured it out myself.
read the documentation
<asp:TextBox runat="server" Width="200px" ID="Name" />
<asp:RequiredFieldValidator runat="server" ID="ValidateName" ControlToValidate="Name"
ErrorMessage="Имя пустое" Display="dynamic">*
</asp:RequiredFieldValidator>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question