webforms - ASP.NET CodeFile, CodeBehind and Inherits -
My confusion is not new here or standing on the web, however, I have some questions for which I have no answer anywhere Not found:
The first question is:
Why is codefile required and not on CodeBhind?
I read: and some more pages, and I understand that the codefile is for source code and for the compilation of the fly, while the second one is for the assembly, it raised another question to me Is:
Why everybody says that I find File.aspx.cs everywhere with a test project and it works like a magic, so should CodeBehind be an assembly? Is this a compiled assembly?
But, on the basis of the first question, and the URL I provided, I can understand why the inheritance is needed. I think the compiler should know what is the name of the partial square to compile later. Makes sense. However, should not it be necessary even on codebehind? If we are going to merge partial classes, then I think I should give the name of the one I want to merge. I also tried to add another partial class in .cs file and compiled it / done well.
Am I missing something here?
I have also read that CodeBehind has not been used anymore and it
thank you all.
Renewed:
I tried to apply an event that used Inherits on CodeBehind, it is not working It was more understandable than it does, but it does not complain on the compilation, while the codefile does. Is there any reason for this?
The property record takes the name of the class written within the code behind the file. You can have multiple squares in the same code behind the file and get it in two different .aspx files
Comments
Post a Comment