6784
asked on
"The server tag is not well formed"
When I view in browser I get this error. "The server tag is not well formed"
What is wrong with this code?
<td style="WIDTH: 257px"><input id=txtAddress style="WIDTH: 220px"
type=text size=20 name=txtAddress runat="server" <td>
Thanks
What is wrong with this code?
<td style="WIDTH: 257px"><input id=txtAddress style="WIDTH: 220px"
type=text size=20 name=txtAddress runat="server" <td>
Thanks
<td style="WIDTH: 257px"><input id="txtAddress" style="WIDTH: 220px" type="text" size="20" name="txtAddress" runat="server" /><td>
ASKER
Any ideas on this one?
The base class includes the field 'txtVenID', but its type (System.Web.UI.WebControls .TextBox) is not compatible with the type of control (System.Web.UI.HtmlControl s.HtmlInpu tText).
Source Error:
Line 23: <td style="WIDTH: 205px"><FONT size="2"
Line 24: >Vender ID:</FONT></td>
Line 25: <td><input id="txtVenID" style="WIDTH: 220px" type="text"
Line 26: size="20" name="txtVenID" runat="server"></td>
Line 27: <td><FONT size=2>Vendor
The base class includes the field 'txtVenID', but its type (System.Web.UI.WebControls
Source Error:
Line 23: <td style="WIDTH: 205px"><FONT size="2"
Line 24: >Vender ID:</FONT></td>
Line 25: <td><input id="txtVenID" style="WIDTH: 220px" type="text"
Line 26: size="20" name="txtVenID" runat="server"></td>
Line 27: <td><FONT size=2>Vendor
<td><asp:TextBox id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server"></td>
If you want an Html text field control:
<td>
<INPUT id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server">
</td>
Else if you want to use a TextBox web control:
<td>
<asp:TextBox id="txtVenID" style="WIDTH: 220px" runat="server" MaxLength="20">
</asp:TextBox>
</td>
<td>
<INPUT id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server">
</td>
Else if you want to use a TextBox web control:
<td>
<asp:TextBox id="txtVenID" style="WIDTH: 220px" runat="server" MaxLength="20">
</asp:TextBox>
</td>
ASKER
when I use an Html text field I get get the above error.
When I use and TextBox web control, the attributes name, type and size are underlined with statements such as "could not find any attribute 'name' of element 'TextBox'.
I heard that Visual Studio messes around with your html code?????
When I use and TextBox web control, the attributes name, type and size are underlined with statements such as "could not find any attribute 'name' of element 'TextBox'.
I heard that Visual Studio messes around with your html code?????
Actually there are no "name" / "type" / "size" properties for TextBox web server control.. so the error you have received is genuine... no messing around :))
You need to write it like this...
<asp:TextBox id="txtVenID" style="WIDTH: 220px" runat="server" MaxLength="20">
You need to write it like this...
<asp:TextBox id="txtVenID" style="WIDTH: 220px" runat="server" MaxLength="20">
ASKER
thanks,
but what if I want to use Html. How do I get around the error they cause (see above)
but what if I want to use Html. How do I get around the error they cause (see above)
Is there another control with the same id "txtVenID".. The error message seems to say so..
The base class includes the field 'txtVenID', but its type (System.Web.UI.WebControls .TextBox) is not compatible with the type of control (System.Web.UI.HtmlControl s.HtmlInpu tText).
Does this give an error message too??
<td>
<INPUT id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server">
</td>
The base class includes the field 'txtVenID', but its type (System.Web.UI.WebControls
Does this give an error message too??
<td>
<INPUT id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server">
</td>
ASKER
No other control named txtVenID. This page does consist of 30+ controls.
Yes, it gets the same error.
This page was built originally with web controls on gridflow. I was having trouble with some controls roaming so I which to flowgrid and built Html controls. I never could get it to preview so I copied the Html into a clean project and it works with no problems. Maybe the problem is deeper than the Html code.
Yes, it gets the same error.
This page was built originally with web controls on gridflow. I was having trouble with some controls roaming so I which to flowgrid and built Html controls. I never could get it to preview so I copied the Html into a clean project and it works with no problems. Maybe the problem is deeper than the Html code.
Okay..
I think your HTML is okay.. there is probably a TextBox declared with the same id in the code-behind file. Look for something like this in the code-behind file (.aspx.cs)..
protected System.Web.UI.WebControls. TextBox txtVenID;
And remove that declaration, it would be a remnant of the old web controls page.
I think your HTML is okay.. there is probably a TextBox declared with the same id in the code-behind file. Look for something like this in the code-behind file (.aspx.cs)..
protected System.Web.UI.WebControls.
And remove that declaration, it would be a remnant of the old web controls page.
ASKER
I commented out all the Protected WithEvents and got the same error for txtVenID. I might have to redo the code-behide page also then add that new page to the project.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.