我得到这个错误:the name 'textbox1' does not exist in the current context
名称“TextBox1中”不存在于当前上下文存在
我的代码:
namespace WebApplication19
{
public partial class Default:System.Web.UI.Page
{
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
if (TextBox1.Text == "msc")
{
RadioButton2.Visible = false;
DropDownList2.Visible = false;
}
else
{
RadioButton1.Visible = false;
DropDownList1.Visible = false;
}
}
}
}
是否有'TextBox1'在'.aspx'?如果_was_和你重命名了,那么你应该在上面的代码中重命名它。 – Oded 2013-03-08 16:20:09
添加到@Oded所说的内容中,检查该文本框是否也在* .designer.cs *文件中 – DGibbs 2013-03-08 16:24:49
y TextBox1仅在designer.cs文件中存在,ID仅在“TextBox1”中。 – 2013-03-08 16:34:38