This is a pretty simple question as i am new to asp.net i am trying to develop a contact us page and i am getting the following error.
“Control ‘ContentPlaceHolder1_nameBox’ of type ‘TextBox’ must be placed inside a form tag with runat=server”
The following is my code so far for that page.
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="ContactUs.aspx.cs" Inherits="Craigavon_Aquatics.ContactUs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<h2>
Contact Us</h2>
<p>
Please fill in the form below to contact us.</p>
<p>
</p>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table style="width: 100%">
<tr>
<td>
Name: (Required)</td>
</tr>
<tr>
<td>
<asp:TextBox ID="nameBox" runat="server" Width="278px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Email: (Required)</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</asp:Content>
Either place a wrapper
<form runat="Server">in your master page around the contentplaceholder, or on that page inside the<asp:Content>tag add a<form runat="server">that surrounds your current content.Site1.Master
-OR-
ContactUs.aspx