Marcus Marcus - 5 months ago 40
C# Question

Visual studio asks for runat server tag on a component that alreayd has it

TextBox1 must be placed inside a form tag with runat=server is the error I get, my code is as follows.

<div >

<asp:Label ID="Label1" runat="server" Text="User"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" class="form-control"></asp:TextBox>

I was wondering why I get this error, and how I can fix it.

Dai Dai

It's asking for a <form> element:

<form runat="server">
        <asp:Label ID="Label1" runat="server" Text="User" />
        <asp:TextBox ID="TextBox1" runat="server" class="form-control" />