Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

"The server tag is not well formed"

Posted on 2004-10-25
12
Medium Priority
?
7,619 Views
Last Modified: 2013-11-19
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
0
Comment
Question by:6784
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
12 Comments
 
LVL 14

Expert Comment

by:dfu23
ID: 12403250
<td style="WIDTH: 257px"><input id="txtAddress" style="WIDTH: 220px" type="text" size="20" name="txtAddress" runat="server" /><td>
0
 

Author Comment

by:6784
ID: 12403808
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.HtmlControls.HtmlInputText).

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
 
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403892
<td><asp:TextBox id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server"></td>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:daffodils
ID: 12404278
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>
0
 

Author Comment

by:6784
ID: 12404665
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?????
0
 
LVL 8

Expert Comment

by:daffodils
ID: 12404809
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">
0
 

Author Comment

by:6784
ID: 12405317
thanks,

but what if I want to use Html. How do I get around the error they cause (see above)
0
 
LVL 8

Expert Comment

by:daffodils
ID: 12405427
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.HtmlControls.HtmlInputText).

Does this give an error message too??
<td>
   <INPUT id="txtVenID" style="WIDTH: 220px" type="text" size="20" name="txtVenID" runat="server">
</td>

0
 

Author Comment

by:6784
ID: 12405649
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.
0
 
LVL 8

Expert Comment

by:daffodils
ID: 12405687
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.
0
 

Author Comment

by:6784
ID: 12405858
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.
0
 
LVL 8

Accepted Solution

by:
daffodils earned 400 total points
ID: 12405951
ohh.. much as I hate to say it.. I think that might take the error out.. it is obvious that some part of 'old code' still thinks that  'txtVenID' is a TextBox and not a Html Control.

On the other hand, why don't you keep it as a TextBox.. web server controls are far better than Html controls.

In ASP.NET, we use Html controls only when a suitable web server control isn't available or when we just need plain HTML stuff.. no server manipulations.. or for a specific requirement.

It might be a better idea to stick with web server control.. to the extent of the availability of server-side handling in code etc.

Use an Html table to position controls.. no reason to use Html controls in ASP.NET, when you have far more advanced set of Web server controls!!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question