当前位置: 动力学知识库 > 问答 > 编程问答 >

visual studio 2008 - How to resolve build error in asp.net website

问题描述:

I have one text box control on aspx page in my .net application.

and in code behind on page load event i wrote:

txt.Text = "Sample"

Now if build website on system [ windows XP ] it build properly but on system [ Windows 7 Enterprise ] it showing following error:

" Name 'txt' is not declared "

What would be the reason.Is that environment specific problem.I am using VS 2008.

网友答案:

had issues similar to this before, usually caused by the designer not updating after adding new control to the page. to fix i would recommend

  1. taking the textbox with id of txt out of the page.
  2. then save the page.
  3. now close the aspx page.
  4. re open the aspx again
  5. place textbox control with id txt back onto the page again and save.

think it should work now.

分享给朋友:
您可能感兴趣的文章:
随机阅读: