Hopefully this will save someone else a bunch of time that I just wasted. I have a large complex form and all of a sudden, I couldn’t add a hidden field. I kept getting the “CS0103: The name ‘[hidden field name]‘ does not exist in the current context”. Long story; short. I had accidentally copied JUST the aspx page in my solution. I had the following:
- Form1.aspx
- Form1.aspx.cs
- Form1 – Copy.aspx
It was that darn “Form1 – Copy.aspx” that was causing all of my grief. I’m not sure how this happened, but I had a couple of instances with VS 2012 crashed on me and I suspect it had something to do with that. Deleted the copy and BINGO; all better now.
Hope this saves you a few hours that I lost.
Posted by kwiebke