|
The change boils down to this - the class you define in your separate code file is no longer merged as a partial class with the .aspx-generated class definition, but rather with another intermediate partial class generated for you that contains protected member variable declarations of server side controls. Interestingly, it's no longer code-beside (a term that Microsoft never endorsed anyway) but really code-up-to-the-left-and-adjacent-to :) Perhaps we should call it code-diagonal...
Syntactically, here's what the change looks like. In beta1 you created a partial class and referenced it in your Page directive like so:
<%@ Page compilewith="mypage.cs" classname="mypage" %>
where mypage.cs looks something like:
public partial class mypage
{
//...
}
this changes in beta2 to the following:
<%@ Page inherits="mypage" codefile="mypage.cs" %>
where mypage.cs now looks something like:
public partial class mypage : System.Web.UI.Page
{
//...
}
Yes, you read that right - the 'inherits' keyword is back, and you are back to authoring the base class for your .aspx-generated class definition again. The difference between this and 1.1 is that you no longer have to declare protected/public member variables whose names match the ids of the controls in the .aspx file. This is apparently done in another intermediate base class that is created as a partial class and combined with your partial class declaration to give you access to the controls in the same way you do in the beta 1 release.
|