-2

Runat error in aspx file:

this is my code:

<table>
    <tr><td>First Name:</td><td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td></tr>
    <tr><td>Last Name:</td><td><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td></tr>
    <tr><td>Username:</td><td><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td></tr>
    <tr><td>Passowrd:</td><td><asp:TextBox ID="TextBox4" TextMode="Password" runat="server"></asp:TextBox></td></tr>
    <tr><td>Confirm Password:</td><td><asp:TextBox ID="TextBox5" TextMode="Password" runat="server"></asp:TextBox></td></tr>
    <tr><td>Gender:</td>
        <td>
            <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                <asp:ListItem>Male</asp:ListItem>
                <asp:ListItem>FeMale</asp:ListItem>
            </asp:RadioButtonList>
        </td>
    </tr>
    <tr><td>Email:</td><td><asp:TextBox ID="TextBox6" TextMode="Email" runat="server"></asp:TextBox></td></tr>
    <tr><td><asp:Button ID="Button1" Text="Register" runat="server"/></td></tr>
</table>

error: Place the control in the form tag with runat = server . and i placed runat server in all the asp codes but its still the same and when im debugging it keep saying me:Place the control in the form tag with runat = server .

user692942
  • 16,398
  • 7
  • 76
  • 175
Amit Hadad
  • 35
  • 5

1 Answers1

0

You have to place your controls in a form element:

<form ID="form1" runat="server">
    <table>
        <tr><td>First Name:</td><td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td></tr>
        <tr><td>Last Name:</td><td><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td></tr>
        <tr><td>Username:</td><td><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td></tr>
        <tr><td>Passowrd:</td><td><asp:TextBox ID="TextBox4" TextMode="Password" runat="server"></asp:TextBox></td></tr>
        <tr><td>Confirm Password:</td><td><asp:TextBox ID="TextBox5" TextMode="Password" runat="server"></asp:TextBox></td></tr>
        <tr><td>Gender:</td>
            <td>
                <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                    <asp:ListItem>Male</asp:ListItem>
                    <asp:ListItem>FeMale</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr><td>Email:</td><td><asp:TextBox ID="TextBox6" TextMode="Email" runat="server"></asp:TextBox></td></tr>
        <tr><td><asp:Button ID="Button1" Text="Register" runat="server"/></td></tr>
    </table>
</form>
Josef Fazekas
  • 447
  • 5
  • 11