G
Guest
CodeBehind looks like this (UML like model)
----------------------------
| System.Web.UI.Page |
----------------------------
^
|
----------------------------
| YourPage.Aspx.cs |
----------------------------
^
|
----------------------------
| YourPage.Aspx |
----------------------------
2.0 is more like this
----------------------------
| System.Web.UI.Page |
----------------------------
^
|
----------------------------------
| YourPage.Aspx.cs - partial |
| YourPage.Aspx - partial |
----------------------------------
Both are required to create a single class, instead of inheriting from the
CodeBehind. Functionally, it works the same way, but it simplifies the
runtime significantly and makes it easier for the person using ASPX alone to
code a class that is more easily recognized as a class. There are some
minuses, under the hood, to the model, as well, but that is a topic for a
more involved thread.
The CodeBeside model allows you to separate your information as you see fit.
While I would not do it, it is possible to do the following:
MyPage.aspx - tags
MyPage.aspx.cs - events from the tags
MyPage.helperFunctions.cs - internal methods used by the events.
....
ad nauseum
All of the partial classes can be compiled together and still only end up
with one class and therefore only one object in memory (for your code, as the
Page object, etc., will still be loaded).
Not sure if that makes sense. For the short answer: CodeBeside is better OO
(more efficient as well as a better object model).
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
----------------------------
| System.Web.UI.Page |
----------------------------
^
|
----------------------------
| YourPage.Aspx.cs |
----------------------------
^
|
----------------------------
| YourPage.Aspx |
----------------------------
2.0 is more like this
----------------------------
| System.Web.UI.Page |
----------------------------
^
|
----------------------------------
| YourPage.Aspx.cs - partial |
| YourPage.Aspx - partial |
----------------------------------
Both are required to create a single class, instead of inheriting from the
CodeBehind. Functionally, it works the same way, but it simplifies the
runtime significantly and makes it easier for the person using ASPX alone to
code a class that is more easily recognized as a class. There are some
minuses, under the hood, to the model, as well, but that is a topic for a
more involved thread.
The CodeBeside model allows you to separate your information as you see fit.
While I would not do it, it is possible to do the following:
MyPage.aspx - tags
MyPage.aspx.cs - events from the tags
MyPage.helperFunctions.cs - internal methods used by the events.
....
ad nauseum
All of the partial classes can be compiled together and still only end up
with one class and therefore only one object in memory (for your code, as the
Page object, etc., will still be loaded).
Not sure if that makes sense. For the short answer: CodeBeside is better OO
(more efficient as well as a better object model).
---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************