'txtName' is not declared. It may be inaccessible due to its protection level

后端 未结 13 1621
暖寄归人
暖寄归人 2020-12-15 19:22

After putting a textbox on my page when I compile it I get the above error:

\'txtName\' is not declared. It may be inaccessible due to its protection level.

13条回答
  •  甜味超标
    2020-12-15 19:53

    Ok, I have this resolved now. It was becuase I had renamed a copy of the .aspx file and which still using the newer versions code behind file.

    The code behind file was looking for txtName.text but on the older version of the .aspx file txtName didnt exist!

    I have excluded the older version of the page from the project and it appears to run ok now.

    Thanks everyone for you help.

提交回复
热议问题