Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

ASP.NET: VSNET2003 to VSNET2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Sokalski - 30 Jun 2006 01:07 GMT
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.
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

bruce barker (sqlwork.com) - 30 Jun 2006 01:34 GMT
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)

>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
[quoted text clipped - 29 lines]
> 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.
Steve C. Orr [MVP, MCSD] - 30 Jun 2006 01:37 GMT
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

Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

>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
[quoted text clipped - 29 lines]
> 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.
Cor Ligthert [MVP] - 30 Jun 2006 06:29 GMT
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

http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx

I hope this helps,

Cor

>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
[quoted text clipped - 29 lines]
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.