473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

codefile vs codebehind in ASP.NET 2.0

Can anyone @ MS help us understand why this change was made?
What value does it add?

(It just seems like an unnecessary semantic change to me)

Thanks!

Nov 19 '05 #1
6 4786
You are likely not to hear anything official from MS here about the
topic...you should take a look at:
http://pluralsight.com/blogs/fritz/a...1/18/5111.aspx

many people don't like it, many people think the beta 2 change is better
than what was in beta 1...some thing it's worse and they should have stuck
to the old model....

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
<no********@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Can anyone @ MS help us understand why this change was made?
What value does it add?

(It just seems like an unnecessary semantic change to me)

Thanks!

Nov 19 '05 #2
CodeBehind still works perfectly in ASP.NET 2.0.

Nov 19 '05 #3
I think it was necessary to accomodate the
changes which partial classes imply.

If you continue to use codebehind,
1.1-type source compilation will be implemented.

If you use codefile, you can take advantage of partial classes.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<no********@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Can anyone @ MS help us understand why this change was made?
What value does it add?

(It just seems like an unnecessary semantic change to me)

Thanks!

Nov 19 '05 #4
You don't have compile code-beside class manually as you had to with in v1.1
with VS.NET 2003 & code-behind class (worked in v1.1 with using Src
attribute in Page directive instead of VS's default Inherits). You make c
ahnge to the class, and the change is reflected automatically.

Another thing being that in old model dynamically generated class derived
from the code-behind class, but with the new model they are one and the same
class. This means that you don't have to have separate declarations for
code-behind members (controls) like with the old model. Also because it is
now only one class, private members are visible from dynamically generated
class to code-beside and vice versa.

There are also pre-compilation features and a few other things that are of
interest.

Have you seen these articles for the idea of this new model?

ASP.NET 2.0 Internals
http://msdn.microsoft.com/asp.net/wh.../internals.asp

Update on changes for Beta 2
http://msdn.microsoft.com/asp.net/wh...ta2update.aspx
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
<no********@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Can anyone @ MS help us understand why this change was made?
What value does it add?

(It just seems like an unnecessary semantic change to me)

Thanks!

Nov 19 '05 #5

Teemu Keiski wrote:
You don't have compile code-beside class manually as you had to with in v1.1 with VS.NET 2003 & code-behind class (worked in v1.1 with using Src
attribute in Page directive instead of VS's default Inherits). You make c ahnge to the class, and the change is reflected automatically.

Another thing being that in old model dynamically generated class derived from the code-behind class, but with the new model they are one and the same class. This means that you don't have to have separate declarations for code-behind members (controls) like with the old model. Also because it is now only one class, private members are visible from dynamically generated class to code-beside and vice versa.

There are also pre-compilation features and a few other things that are of interest.

Have you seen these articles for the idea of this new model?

ASP.NET 2.0 Internals
http://msdn.microsoft.com/asp.net/wh.../internals.asp
Update on changes for Beta 2
http://msdn.microsoft.com/asp.net/wh...ta2update.aspx
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
<no********@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Can anyone @ MS help us understand why this change was made?
What value does it add?

(It just seems like an unnecessary semantic change to me)

Thanks!

You still have a code behind file for the page, it's just a partial
class now. Could they have not just left it alone and figured out
which style v1.x or 2.0 the code was using by the presence of the class
being declared as partial??

Nov 19 '05 #6
see below,

<no********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...

Teemu Keiski wrote:
You don't have compile code-beside class manually as you had to with

in v1.1
with VS.NET 2003 & code-behind class (worked in v1.1 with using Src
attribute in Page directive instead of VS's default Inherits). You

make c
ahnge to the class, and the change is reflected automatically.

Another thing being that in old model dynamically generated class

derived
from the code-behind class, but with the new model they are one and

the same
class. This means that you don't have to have separate declarations

for
code-behind members (controls) like with the old model. Also because

it is
now only one class, private members are visible from dynamically

generated
class to code-beside and vice versa.

There are also pre-compilation features and a few other things that

are of
interest.

Have you seen these articles for the idea of this new model?

ASP.NET 2.0 Internals

http://msdn.microsoft.com/asp.net/wh.../internals.asp

Update on changes for Beta 2
http://msdn.microsoft.com/asp.net/wh...ta2update.aspx
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
<no********@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
> Can anyone @ MS help us understand why this change was made?
> What value does it add?
>
> (It just seems like an unnecessary semantic change to me)
>
> Thanks!
>

You still have a code behind file for the page, it's just a partial
class now. Could they have not just left it alone and figured out
which style v1.x or 2.0 the code was using by the presence of the class
being declared as partial??


Well, there's still the good part like no need to declare members in the
code file. :-) I think following post at ASP.NET Forums covers the reasoning
quite well, see especially Scott Guthrie's comments.
http://forums.asp.net/765218/ShowPost.aspx
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Graham Allwood | last post by:
I'm reading the Essential ASP.NET book by Fritz onion and he says that when VS.NET creates a new .aspx page for you is uses the codebehind attribute on the Page directive rather than the src...
12
by: A.M | last post by:
Hi, Using VS.NET 2003, If i use SRC page attribute instead of CodeBehind, do i still have intelisence and generally IDE support for that? Thanks, Ali
3
by: nevets2001uk | last post by:
Hi. I've just started my second ASP.NET (VB) app and I'm using codebehind this time. I'm not using visual studio but am instead coding it all in notepad (HTML, ASP.NET and CSS) I'm trying to...
12
by: Karl Hungus | last post by:
If I use a code behind class for an aspx page, what is the best way to get data from the codebehind class into my aspx page? I know about databinding, but is there a more basic way of just...
2
by: Michael Tissington | last post by:
How do I specify the CodeFile for my Global.asax file ? According to the documentation I can use the CodeFile attribute with Application, however when I try to use this I get an error saying that...
5
by: WT | last post by:
Hello, In my Global.asax file, I have only an @ Application directive like <%@ Application Language="C#" Inherits="WT.Global" CodeFile="Global.asax.cs" %> Visual studio complains saying...
2
by: jobs | last post by:
stupid question which I once think I had the answer to I'm sure. I create webform page with no codebehind. I then decide I want to create a codebehind for it. How can I do it so that it...
1
by: IfThenElse | last post by:
Hi, None of my .aspx pages in a new ASP.NET 2.0 VS.NET2005 Solution/Project have CodeFile="" what does that mean? only have CodeBehind="" Any Idea?
3
by: Cirene | last post by:
Usually I like to have my vb code in a seperate file, rather than inline with the HTML. I know that the codefile directive is what links the 2 together. For some reason, all of a sudden my new...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.