Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with textbox.value 1

Status
Not open for further replies.

nicklieb

Programmer
Oct 17, 2002
383
GB
for some reason my page is erroring on the text box. When I view the code is see the textbox initition

Code:
protected System.Web.UI.WebControls.TextBox txtusername;
protected System.Web.UI.WebControls.TextBox txtpassword;

but that's not what I want...I want the following

Code:
protected System.Web.UI.HtmlControls.HtmlInputText txtusername;
protected System.Web.UI.HtmlControls.HtmlInputText txtpassword;

but when i switch back design view vis studion changes it back to the latter... As a result I get the following error

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

I can't select from the dropdown the type I want.. I am dragging the textbox off the toolbox

thanks in advance
 
Delete the existing textbox and in the code-behind ensure the declarations are also gone.

Drag a html textbox onto the designer.

Right-click on the html text box and select "Run as server control"

In the code-behind you should not have

protected System.Web.UI.HtmlControls.HtmlInputText txtusername;

Hope this helps
 
if the poster of this is Nick Liebman formerly of IpInnovation "hello this is Mick Holland", if not sorry, either way thanks for the star.
 
:) yes it is.. long time no hear.. what's yer email, send one to my trash email and will send you one back devilled_kidneys@hotmail.com.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top