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

后端 未结 13 1611
暖寄归人
暖寄归人 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 20:02

    I had a different cause for the exact same error and it is similar to what the OP found but not quite. My page.aspx.designer.vb got out of sync and had an error. One of my controls was being defined twice (I think because I copy/pasted an existing control without editing the ID before pasting). Once I deleted the 2nd declaration I could build and the errors were gone. Interestingly, VS 2010 SP1 didn't list THAT error along with the others resulting from the lack of that page building. Hope this helps someone else.

提交回复
热议问题