Board index » Visual Studio » ASP.NET: VSNET2003 to VSNET2005

ASP.NET: VSNET2003 to VSNET2005

Visual Studio36
I just upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.

There are several questions I have about the code differences between them

(I use VB.NET for as my language of choice):



1. 2003 used "Public Class classname" and 2005 uses "Partial Class

classname". What, if any, difference is there between these?



2. The following things are included in the #Region " Web Form Designer

Generated Code " part of 2003's code, and are not included automatically in

2005:



<System.Diagnostics.DebuggerStepThrough()>Private Sub

InitializeComponent()

End Sub





Control declarations, such as:

Protected WithEvents lblWebsite As System.Web.UI.WebControls.Label





Private designerPlaceholderDeclaration As System.Object





Private Sub Page_Init(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Init

InitializeComponent()

End Sub



Do I need to include any of these manually or anything else that serves

their purpose?



3. In 2003 the Page Events use clauses such as Handles MyBase.Load while

2005 uses Handles Me.Load. I am assuming that these will work the same?





I am sure that I will run into the other differences between the two, but

these are some of the important ones for me right now. Thanks.

--

Nathan Sokalski

njsokalski@hotmail.com

www.nathansokalski.com/


-
 

Re:ASP.NET: VSNET2003 to VSNET2005

the main difference from 2003 to 2005, is how a page is compiled.



in 2003 when asp.net compiled an aspx, it had the page inherit from the code

behind file, which VS had compiled into a separate dll. this required the

funky double declare of controls, and linking up the events. note there are

two compiles, the codebehind into a dll by vs, and each aspx page as a

separate dll by the asp.net compiler.



in 2005 there is a new feature called partial classes. this allows a class

to be broken into two files and compiled together. VS no longer compiles the

code behind files into their own dll. the asp.net compiler does all the

work, so the codebehind is in the same dll as the aspx page. because the

codebehind and the aspx page code is merged thru the magic of partial

classes, then a control is defined in aspx, the codebehind knows about it.



-- bruce (sqlwork.com)



"Nathan Sokalski" <njsokalski@hotmail.com>wrote in message

Quote
I just upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.

There are several questions I have about the code differences between them

(I use VB.NET for as my language of choice):



1. 2003 used "Public Class classname" and 2005 uses "Partial Class

classname". What, if any, difference is there between these?



2. The following things are included in the #Region " Web Form Designer

Generated Code " part of 2003's code, and are not included automatically

in 2005:



<System.Diagnostics.DebuggerStepThrough()>Private Sub

InitializeComponent()

End Sub





Control declarations, such as:

Protected WithEvents lblWebsite As System.Web.UI.WebControls.Label





Private designerPlaceholderDeclaration As System.Object





Private Sub Page_Init(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Init

InitializeComponent()

End Sub



Do I need to include any of these manually or anything else that serves

their purpose?



3. In 2003 the Page Events use clauses such as Handles MyBase.Load while

2005 uses Handles Me.Load. I am assuming that these will work the same?





I am sure that I will run into the other differences between the two, but

these are some of the important ones for me right now. Thanks.

--

Nathan Sokalski

njsokalski@hotmail.com

www.nathansokalski.com/">www.nathansokalski.com/







-

Re:ASP.NET: VSNET2003 to VSNET2005

1) A partial class just means that the class is split across one or more

files. "Partial" has no effect on whether a class is public or private.



2) No



3) Yes



--

I hope this helps,

Steve C. Orr, MCSD, MVP

SteveOrr.net">SteveOrr.net







"Nathan Sokalski" <njsokalski@hotmail.com>wrote in message

Quote
I just upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.

There are several questions I have about the code differences between them

(I use VB.NET for as my language of choice):



1. 2003 used "Public Class classname" and 2005 uses "Partial Class

classname". What, if any, difference is there between these?



2. The following things are included in the #Region " Web Form Designer

Generated Code " part of 2003's code, and are not included automatically

in 2005:



<System.Diagnostics.DebuggerStepThrough()>Private Sub

InitializeComponent()

End Sub





Control declarations, such as:

Protected WithEvents lblWebsite As System.Web.UI.WebControls.Label





Private designerPlaceholderDeclaration As System.Object





Private Sub Page_Init(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Init

InitializeComponent()

End Sub



Do I need to include any of these manually or anything else that serves

their purpose?



3. In 2003 the Page Events use clauses such as Handles MyBase.Load while

2005 uses Handles Me.Load. I am assuming that these will work the same?





I am sure that I will run into the other differences between the two, but

these are some of the important ones for me right now. Thanks.

--

Nathan Sokalski

njsokalski@hotmail.com

www.nathansokalski.com/">www.nathansokalski.com/







-

Re:ASP.NET: VSNET2003 to VSNET2005

Nathan,



If you are converting than you can decide to do it this way,

Be aware that this adds a fourth method how you can use ASPX in version 2005



msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx">msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx



I hope this helps,



Cor



"Nathan Sokalski" <njsokalski@hotmail.com>schreef in bericht

Quote
I just upgraded from Visual Studio .NET 2003 to Visual Studio .NET 2005.

There are several questions I have about the code differences between them

(I use VB.NET for as my language of choice):



1. 2003 used "Public Class classname" and 2005 uses "Partial Class

classname". What, if any, difference is there between these?



2. The following things are included in the #Region " Web Form Designer

Generated Code " part of 2003's code, and are not included automatically

in 2005:



<System.Diagnostics.DebuggerStepThrough()>Private Sub

InitializeComponent()

End Sub





Control declarations, such as:

Protected WithEvents lblWebsite As System.Web.UI.WebControls.Label





Private designerPlaceholderDeclaration As System.Object





Private Sub Page_Init(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Init

InitializeComponent()

End Sub



Do I need to include any of these manually or anything else that serves

their purpose?



3. In 2003 the Page Events use clauses such as Handles MyBase.Load while

2005 uses Handles Me.Load. I am assuming that these will work the same?





I am sure that I will run into the other differences between the two, but

these are some of the important ones for me right now. Thanks.

--

Nathan Sokalski

njsokalski@hotmail.com

www.nathansokalski.com/">www.nathansokalski.com/







-