By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.....

Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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.....

Jul 21 '05 #2

P: n/a
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.....


Jul 21 '05 #3

P: n/a
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.....


Jul 21 '05 #4

P: n/a
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.....



Jul 21 '05 #5

P: n/a
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.....
>
>
>



Jul 21 '05 #6

P: n/a
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.....
> >
> >
> >
>
>



Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.