“ELEMENT'Textbox'不是已知元素如果出现编译错误或者缺少web.config,则可能会出现这种情况。 [英] "ELEMENT 'Textbox' is not a known element This may occur if there is a compilation error or web.config is missing"

查看:409
本文介绍了“ELEMENT'Textbox'不是已知元素如果出现编译错误或者缺少web.config,则可能会出现这种情况。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我的表单中有一个文本框和其他控件。问题是我得到一个绿线强调我的控件说元素'文本框'不是一个已知的元素如果有编译错误或web.config丢失可能会发生这种情况但项目运行正常。我应该在哪里解决这个错误?

解决方案

它应该是TextBox(它区分大小写)。



编辑==================



绿色intellisense下划线仅仅是一个警告。试着这样做:



< asp:TextBox blah blah>< / asp:TextBox> 





有时它会清除奇怪的警告。





评论:



0)给文本框一个 ID 的DatePicker令人困惑。将您的身份证更改为更合适的身份。



1)已启用默认为true,您不需要指定它。



2)将您的CSSClass名称更改为*不是*textbox。将其称为textboxStyle或类似的东西。


只需检查您是否遗漏了文本框之前或之后的任何其他标记的关闭。


< blockquote>只是检查你可能缺少表格标签动作。



就像你的代码是: -



< form>

< asp:textbox id =txtsubscriberunat =servertype =textclass =text>



< / form>



正确代码: -



< form action =#>

< asp:textbox id =txtsubscriberunat =servertype =textclass =text>



< / form>



绿线问题解决....



thankyou


Hi I have a textbox and other controls in my form. The problem is I get a greenline underlining my controls saying "ELEMENT 'Textbox' is not a known element This may occur if there is a compilation error or web.config is missing" But the project is running fine. Where should I look to solve this error?

解决方案

It's supposed to be TextBox (it's case-sensitive).

EDIT ==================

The green intellisense underline is merely a warning. Try doing this:

<asp:TextBox blah blah ></asp:TextBox>



Sometimes it clears up weird warnings.


Comments:

0) giving a textbox an ID of "DatePicker" is confusing. Change your ID to something more appropriate.

1) Enabled is true by default, you don't need to specify it.

2) Change your CSSClass name to something that *isn't* "textbox". Call it "textboxStyle" or something like that.


Just check you may be missing closing of any other tag which is before or after your text box.


Just check you may be missing form tag action.

like your code is:-

<form>
<asp:textbox id="txtsubscribe" runat="server" type="text" class="text">

</form>

right code:-

<form action="#">
<asp:textbox id="txtsubscribe" runat="server" type="text" class="text">

</form>

greenline problem solve....

thankyou


这篇关于“ELEMENT'Textbox'不是已知元素如果出现编译错误或者缺少web.config,则可能会出现这种情况。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆