473,399 Members | 2,146 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,399 software developers and data experts.

Partial Types with Code Behind Pages in ASP.NET 2.0?

I just read on Slash Dot about partial types.

Now, is it possible to have a code behind split over two pages but still
referencing the same .aspx file???

If so, that would be really nice as every now and then there is some code
behind code that just gets to be a lot for a single .aspx page
Untitled.aspx
Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx

So when I hit the Untitled.aspx with my browser, it automatically JITs both
the split code behind pages together....this seems like something very
doable in ASP.NET 2.0.....

Nov 15 '05 #1
6 1398
Yes, that is what partial types means. You will be able to split up the
definition of your class "Untitled" between multiple .cs files.

That said, there is no guarantee that the VS IDE will support multiple
code-behind files for ASPX pages. Just because the language and framework
support it, doesn't mean the IDE will (think in-line server-sie code,
multi-file assemblies, etc).

"nospam" <n@ntspam.com> wrote in message
news:el**************@TK2MSFTNGP11.phx.gbl...
I just read on Slash Dot about partial types.

Now, is it possible to have a code behind split over two pages but still
referencing the same .aspx file???

If so, that would be really nice as every now and then there is some code
behind code that just gets to be a lot for a single .aspx page
Untitled.aspx
Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx

So when I hit the Untitled.aspx with my browser, it automatically JITs both the split code behind pages together....this seems like something very
doable in ASP.NET 2.0.....

Nov 15 '05 #2
Watch the nightmare of missmash of wizard code being, not that its bad
enough already with it stomping all over #regions, now its gona spam .cs
files.

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:#O**************@TK2MSFTNGP09.phx.gbl...
Yes, that is what partial types means. You will be able to split up the
definition of your class "Untitled" between multiple .cs files.

That said, there is no guarantee that the VS IDE will support multiple
code-behind files for ASPX pages. Just because the language and framework
support it, doesn't mean the IDE will (think in-line server-sie code,
multi-file assemblies, etc).

"nospam" <n@ntspam.com> wrote in message
news:el**************@TK2MSFTNGP11.phx.gbl...
I just read on Slash Dot about partial types.

Now, is it possible to have a code behind split over two pages but still
referencing the same .aspx file???

If so, that would be really nice as every now and then there is some code behind code that just gets to be a lot for a single .aspx page
Untitled.aspx
Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx

So when I hit the Untitled.aspx with my browser, it automatically JITs

both
the split code behind pages together....this seems like something very
doable in ASP.NET 2.0.....


Nov 15 '05 #3
So, are you saying that the .aspx file will have a place for you to tell it
to
have multiple src= files?

right now all you can put is src="Untititled.aspx.cs"

Where would I put the other file name ?

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Yes, that is what partial types means. You will be able to split up the
definition of your class "Untitled" between multiple .cs files.

That said, there is no guarantee that the VS IDE will support multiple
code-behind files for ASPX pages. Just because the language and framework
support it, doesn't mean the IDE will (think in-line server-sie code,
multi-file assemblies, etc).

"nospam" <n@ntspam.com> wrote in message
news:el**************@TK2MSFTNGP11.phx.gbl...
I just read on Slash Dot about partial types.

Now, is it possible to have a code behind split over two pages but still
referencing the same .aspx file???

If so, that would be really nice as every now and then there is some code behind code that just gets to be a lot for a single .aspx page
Untitled.aspx
Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx

So when I hit the Untitled.aspx with my browser, it automatically JITs

both
the split code behind pages together....this seems like something very
doable in ASP.NET 2.0.....


Nov 15 '05 #4
Ok, it has been confirmed that the IDE will use partial types, in a major
way. Partial types will be integral to the replacement of the current
code-behind method.

Paul Wilson explains the new "code beside" model in this article, about the
next version of VS.NET:
http://authors.aspalliance.com/PaulW...rticles/?id=19
"nospam" <n@ntspam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
So, are you saying that the .aspx file will have a place for you to tell it to
have multiple src= files?

right now all you can put is src="Untititled.aspx.cs"

Where would I put the other file name ?

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Yes, that is what partial types means. You will be able to split up the
definition of your class "Untitled" between multiple .cs files.

That said, there is no guarantee that the VS IDE will support multiple
code-behind files for ASPX pages. Just because the language and framework
support it, doesn't mean the IDE will (think in-line server-sie code,
multi-file assemblies, etc).

"nospam" <n@ntspam.com> wrote in message
news:el**************@TK2MSFTNGP11.phx.gbl...
I just read on Slash Dot about partial types.

Now, is it possible to have a code behind split over two pages but still referencing the same .aspx file???

If so, that would be really nice as every now and then there is some

code behind code that just gets to be a lot for a single .aspx page
Untitled.aspx
Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx

So when I hit the Untitled.aspx with my browser, it automatically JITs

both
the split code behind pages together....this seems like something very
doable in ASP.NET 2.0.....



Nov 15 '05 #5
Ok, thanks.

However, how does the the MyFile.aspx.cs file know where the other part of
the partial file is in the first place.

I can see from the codebesides attrtibute "compileswith" shows the first
partial file, but what about the second and third, etc. partial files that
go with the first file?

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
Ok, it has been confirmed that the IDE will use partial types, in a major
way. Partial types will be integral to the replacement of the current
code-behind method.

Paul Wilson explains the new "code beside" model in this article, about the next version of VS.NET:
http://authors.aspalliance.com/PaulW...rticles/?id=19
"nospam" <n@ntspam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
So, are you saying that the .aspx file will have a place for you to tell

it
to
have multiple src= files?

right now all you can put is src="Untititled.aspx.cs"

Where would I put the other file name ?

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Yes, that is what partial types means. You will be able to split up the definition of your class "Untitled" between multiple .cs files.

That said, there is no guarantee that the VS IDE will support multiple
code-behind files for ASPX pages. Just because the language and framework support it, doesn't mean the IDE will (think in-line server-sie code,
multi-file assemblies, etc).

"nospam" <n@ntspam.com> wrote in message
news:el**************@TK2MSFTNGP11.phx.gbl...
> I just read on Slash Dot about partial types.
>
> Now, is it possible to have a code behind split over two pages but still > referencing the same .aspx file???
>
> If so, that would be really nice as every now and then there is some
code
> behind code that just gets to be a lot for a single .aspx page
>
>
> Untitled.aspx
> Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
> Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx
>
>
>
> So when I hit the Untitled.aspx with my browser, it automatically

JITs both
> the split code behind pages together....this seems like something very > doable in ASP.NET 2.0.....
>
>
>



Nov 15 '05 #6
It does not have to know

The compiler knows.

I would say that the compiler first creates a list of all types (which it
needs anyway), and at this point it can link them together.

Dont forget: partial types are a COMPILER feature. They dont exist in the
assembly.

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)

"nospam" <n@ntspam.com> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...
Ok, thanks.

However, how does the the MyFile.aspx.cs file know where the other part of
the partial file is in the first place.

I can see from the codebesides attrtibute "compileswith" shows the first
partial file, but what about the second and third, etc. partial files that
go with the first file?

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
Ok, it has been confirmed that the IDE will use partial types, in a major
way. Partial types will be integral to the replacement of the current
code-behind method.

Paul Wilson explains the new "code beside" model in this article, about the
next version of VS.NET:
http://authors.aspalliance.com/PaulW...rticles/?id=19
"nospam" <n@ntspam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
So, are you saying that the .aspx file will have a place for you to tell
it
to
have multiple src= files?

right now all you can put is src="Untititled.aspx.cs"

Where would I put the other file name ?

"Joshua Flanagan" <jo**@msnews.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> Yes, that is what partial types means. You will be able to split up

the > definition of your class "Untitled" between multiple .cs files.
>
> That said, there is no guarantee that the VS IDE will support
multiple > code-behind files for ASPX pages. Just because the language and

framework
> support it, doesn't mean the IDE will (think in-line server-sie code, > multi-file assemblies, etc).
>
> "nospam" <n@ntspam.com> wrote in message
> news:el**************@TK2MSFTNGP11.phx.gbl...
> > I just read on Slash Dot about partial types.
> >
> > Now, is it possible to have a code behind split over two pages but

still
> > referencing the same .aspx file???
> >
> > If so, that would be really nice as every now and then there is

some code
> > behind code that just gets to be a lot for a single .aspx page
> >
> >
> > Untitled.aspx
> > Untitled.aspx.1.cs <- part 1 that works with Untitled.aspx
> > Untitled.aspx.2.cs <- part 2 that works with Untitled.aspx
> >
> >
> >
> > So when I hit the Untitled.aspx with my browser, it automatically JITs > both
> > the split code behind pages together....this seems like something very > > doable in ASP.NET 2.0.....
> >
> >
> >
>
>



Nov 15 '05 #7

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

Similar topics

6
by: nospam | last post by:
I just read on Slash Dot about partial types. Now, is it possible to have a code behind split over two pages but still referencing the same .aspx file??? If so, that would be really nice as...
43
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the...
0
by: nospam | last post by:
I just read on Slash Dot about partial types. Now, is it possible to have a code behind split over two pages but still referencing the same .aspx file??? If so, that would be really nice as...
16
by: pawel.pabich | last post by:
Hajo, I would like to have 2 my own partial classes. For example: Default.aspx.cs Default2.aspx.cs and they both will relate to Default.aspx page.
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.