As we all know, the partial local class is a new product of. NET 2.0. It allows the implementation of the class to be split and stored in different CS files. When using the partial local class, you must use the "partial" Explicit declaration.
Originally, we thought that the "partial" keyword is not used when we do not use the partial local class. However, every time we create a web form file, VS 2005 will automatically go to the CS backgroundCodeUse the following method to declare the Form class in the file:
Public partial class itgao_com: system. Web. UI. Page
{
Protected void page_load (Object sender, eventargs E)
{
}
}
It is a bit confusing, so I will delete the partial keyword in the above Code and want to see if this partial is a general setting for vs2005 to adapt to local classes. Result 1: After debugging, the system prompts:
The partial modifier is missing in the declaration of the "itgao_com" type of error 1; other partial declarations of this type exist D: \ net2.0 learning \ Generic and other new features \ WEB \ csharp20 \ itgao_com.aspx.cs 12 14 d :\... \ WEB \
Is that true?ProgramIn other parts of the project, what about "the other half" of partial class itgao_com? No second itgao_com class was found throughout the project, except for the front-end aspx file corresponding to itgao_com. It seems that I am wrong.
After some thought, I suddenly realized. Asp.net itself allows programs to be written directly on the ASPX page. Isn't that the "Other Half" of the partial class itgao_com I'm looking? Haha. In this case, the Asp.net 1.x version has long been a prototype of the partial local class.
Asp.net 1. in Version X, the front-end page and the backend CS file can write programs at the same time. Therefore, I think Asp.net 1. version X already uses the partial mechanism, but it is limited to the partial between the ASPX page and the corresponding CS, and 2.0 extends it to all classes.