ike2010
asked on
Parser error: Base class, type mismatch
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.HtmlControl s.HtmlInpu tText) 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 .HtmlInput Text. 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_cs.txt
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
"The base class includes the field 'txtPassword', but its type (System.Web.UI.HtmlControl
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:
Line 89: </tr>
Line 90: <tr>
The interesting thing here is that txtPassword is not of type System.Web.UI.HtmlControls
Here is my code:
http://www.geocities.com/eric_eichler/login_cs.txt
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
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.
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.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
surely the problem is TextMode="Password" isn't supported by a standard input text control ????
change protected System.Web.UI.HtmlControls
to
protected System.Web.UI.HtmlControls