Resolution of "Name XXX not present in current context"

Source: Internet
Author: User
Tags copy net bug visual studio

The root cause of this is that when you build a new file, for convenience, my ready-made files to copy, the results appear two identical. CS class is partial class, two different files of the same ASPX and ASPx.CS class is the same thing, one of the files have changed, and the other does not change at all. It's just that the user doesn't know.
For example, if you build a test.aspx, you will generate a xxx_test class (XXX may be a directory) in TEST.ASPX.CS and then copy and paste a test.aspx, renamed Test123.aspx, in Test123.aspx. The class in CS does not change at all, this time the class or xxx_test will appear two different. aspx files have the same class code, and if one side changes, the other goes wrong ...
The best way to avoid this is to copy the same code after creating a new file.

Case 1,
Yesterday I was able to easily use the Save as to copy an. aspx page, so the problem arises
Workaround:
Copy the code once save as page and delete it, create a new page, and then copy the code in to solve the problem!!!
I don't know if it's. NET bug?
Case 2,
Today, with Visual Studio 2005 to open the Web site, rebuilt, found that the current context does not exist in the name Txtverifycoce, very strange, directly run the Web site can be, to get rid of the name or not. Check the Internet, there are similar errors, found the reason: I changed the Login.aspx, afraid to change the wrong, copy a copy, the duplicate login.aspx deleted on the OK. I don't know if this is a visual bug.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.