Parser error:  Base class, type mismatch

Posted on 2005-03-03
Medium Priority
Last Modified: 2012-05-05
Hello all. I have a login page that uses a web form textbox for the username and web form textbox for the password. Everything compiles fine, but when my browser tries to load the page I get a parser error:

"The base class includes the field 'txtPassword', but its type (System.Web.UI.HtmlControls.HtmlInputText) is not compatible with the type of control (System.Web.UI.WebControls.TextBox)."

Line 86: <td width="10" height="17"></td>
Line 87: <td height="17">
Line 88: <asp:TextBox id="txtPassword" runat="server" width="150" TextMode="Password"></asp:TextBox></td>
Line 89: </tr>
Line 90: <tr>

The interesting thing here is that txtPassword is not of type System.Web.UI.HtmlControls.HtmlInputText. I create the textbox by dragging the TextBox tool from the Web Forms tool box. Also, in my code behind I call txtPassword.Text and it works everywhere else in my web app. Any ideas? Thanks.

Here is my code:

http://www.geocities.com/eric_eichler/login.txt  (you'll have to 'view source' to see the code on this one)

server is running Windows Server 2003

Question by:ike2010
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
  • 2
  • 2

Expert Comment

ID: 13449874
In login.cs  

change   protected System.Web.UI.HtmlControls.HtmlInputText txtUserName;


protected System.Web.UI.HtmlControls.TextBox txtUserName;
LVL 12

Expert Comment

ID: 13450136
I think the code is all right.
You should rebuild the project and run it again.
I guess you used html server control before and replaced it with web form control and something is still there.
LVL 12

Accepted Solution

laotzi2000 earned 800 total points
ID: 13450141
especially the code behind dll.
From your code, you're mixing vb and c#, so I don't think the dll will be deployed automatically.

Expert Comment

ID: 13450184
surely the problem is  TextMode="Password"  isn't supported by a standard input text control ????

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

752 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