我得到這個錯誤: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