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

Dear MICROSOFT, more details on Partial Types, PLEASE.....

Ok, I asked this question before and I also looked at the book "First Look
at ASP.NET 2.0"
I also read Paul wilson's web page explanation. HOWEVER......

The book and that web page talks about partial types and that IF you have a
Extends keyword, I think, before the class name AND the same Namespace, .NET
will automatically compile the rest of the class that is located in another
file.

However, I want to know just exactly how is .NET going to find that OTHER
file......

There is the .aspx page that has the complieswith attribute and some other
attribute that can as before look for the CodeBehind file.

However, just exactly how does .NET find the other FILE????????

Does it search first and READ every single FILE in the same directory and
work it's way out to the other files within the application to find a class
name and namespace that matches?


Jul 21 '05 #1
21 1606
Ah nospam... Good question..

The Spec for C# version 2 contains a new keyword for
partial types..

"partial"

it is used in the class declarations..

i.e.

public partial class Customer
{
//Some of the implementation here
...
}

public partial class Customer
{
//The rest of the implementation here
...
}

HTH...
-----Original Message-----
Ok, I asked this question before and I also looked at the book "First Lookat ASP.NET 2.0"
I also read Paul wilson's web page explanation. HOWEVER......
The book and that web page talks about partial types and that IF you have aExtends keyword, I think, before the class name AND the same Namespace, .NETwill automatically compile the rest of the class that is located in anotherfile.

However, I want to know just exactly how is .NET going to find that OTHERfile......

There is the .aspx page that has the complieswith attribute and some otherattribute that can as before look for the CodeBehind file.
However, just exactly how does .NET find the other FILE????????
Does it search first and READ every single FILE in the same directory andwork it's way out to the other files within the application to find a classname and namespace that matches?


.

Jul 21 '05 #2
Cor
Hi Nospam,

First of all, this Public newsgroups is not Microsoft. There are Microsoft
people participating and Microsoft people checks themself for intresting
things and totaly bad behaviour in this Newsgroups, but it is never
Microsoft who answers, it are always individuals, even if they are from
Microsoft.

But to help you, maybe this first row from the aspx page will tell you
something

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="WebApplication1.WebForm1"%>

The code behind is clear I think and it Inherits the WebForm1 class, which
itself inherits the System.Web.UI.page when you see that.

The user does not see it, because when it is send, this information is not
sended.

I hope this helps you a little bit.

Cor
Jul 21 '05 #3
Yes, I can see that it's broken up into 2 parts. I know that already.

I want to know how does .NET know where to find the other part when only ONE
(1) of them is specifically declared in the @Page directive of the .aspx
page and the other file is NOT.

Basically only ONE (1) file name is known. How does it know how to find the
other files of the partial types that could be anywhere in the application?
Do you have to compile the whole entire thing? What about JIT then?

"Eddie de Bear" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Ah nospam... Good question..

The Spec for C# version 2 contains a new keyword for
partial types..

"partial"

it is used in the class declarations..

i.e.

public partial class Customer
{
//Some of the implementation here
..
}

public partial class Customer
{
//The rest of the implementation here
..
}

HTH...
-----Original Message-----
Ok, I asked this question before and I also looked at

the book "First Look
at ASP.NET 2.0"
I also read Paul wilson's web page explanation.

HOWEVER......

The book and that web page talks about partial types and

that IF you have a
Extends keyword, I think, before the class name AND the

same Namespace, .NET
will automatically compile the rest of the class that is

located in another
file.

However, I want to know just exactly how is .NET going

to find that OTHER
file......

There is the .aspx page that has the complieswith

attribute and some other
attribute that can as before look for the CodeBehind

file.

However, just exactly how does .NET find the other

FILE????????

Does it search first and READ every single FILE in the

same directory and
work it's way out to the other files within the

application to find a class
name and namespace that matches?


.

Jul 21 '05 #4
You don't understand what I am getting at.

There are at least THREE (3) files in a partial type.

(1) MyPartialType.aspx file <-- .aspx web page

(2) MyPartialType.aspx.cs file <-- standard code behind already referenced
in the (1) above

(3) MyPartialTypeWhereAmI.aspx.cs <----- file that I don't know how .NET
knows where it's at????????
How does it, .NET, know where (3) is?????????????

"Cor" <no*@non.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi Nospam,

First of all, this Public newsgroups is not Microsoft. There are Microsoft
people participating and Microsoft people checks themself for intresting
things and totaly bad behaviour in this Newsgroups, but it is never
Microsoft who answers, it are always individuals, even if they are from
Microsoft.

But to help you, maybe this first row from the aspx page will tell you
something

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1"%>

The code behind is clear I think and it Inherits the WebForm1 class, which
itself inherits the System.Web.UI.page when you see that.

The user does not see it, because when it is send, this information is not
sended.

I hope this helps you a little bit.

Cor

Jul 21 '05 #5
Hi nospam

Considering your apparent dislike of OO techniques, and your embracement of
the KISS principle, why would you be using partial types?

Personally I have NEVER found the NEED for them (or capitals in every line)
:)

Regards

Ron

"nospam" <n@ntspam.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
Ok, I asked this question before and I also looked at the book "First Look at ASP.NET 2.0"
I also read Paul wilson's web page explanation. HOWEVER......

The book and that web page talks about partial types and that IF you have a Extends keyword, I think, before the class name AND the same Namespace, ..NET will automatically compile the rest of the class that is located in another file.

However, I want to know just exactly how is .NET going to find that OTHER
file......

There is the .aspx page that has the complieswith attribute and some other
attribute that can as before look for the CodeBehind file.

However, just exactly how does .NET find the other FILE????????

Does it search first and READ every single FILE in the same directory and
work it's way out to the other files within the application to find a class name and namespace that matches?

Jul 21 '05 #6
Cor
Hi Nospam,
Do you use build code, made by Visual.studio Net?
Cor
(1) MyPartialType.aspx file <-- .aspx web page

(2) MyPartialType.aspx.cs file <-- standard code behind already referenced
in the (1) above

(3) MyPartialTypeWhereAmI.aspx.cs <----- file that I don't know how .NET
knows where it's at????????

Jul 21 '05 #7
"Build Code"? or do you mean, "Do I build code with VS.NET?"

All I want to know is how does .NET find #3.

"Cor" <no*@non.com> wrote in message
news:O9*************@TK2MSFTNGP11.phx.gbl...
Hi Nospam,
Do you use build code, made by Visual.studio Net?
Cor
(1) MyPartialType.aspx file <-- .aspx web page

(2) MyPartialType.aspx.cs file <-- standard code behind already referenced in the (1) above

(3) MyPartialTypeWhereAmI.aspx.cs <----- file that I don't know how .NET
knows where it's at????????


Jul 21 '05 #8
Partial Types are needed when you want to do a LOT of STUFF

I just want to know how .NET find the third file #3( the one that's who's
path is not given on the .aspx or code behind file, that's all.

"Ron McNulty" <rm******@xtra.co.nz> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi nospam

Considering your apparent dislike of OO techniques, and your embracement of the KISS principle, why would you be using partial types?

Personally I have NEVER found the NEED for them (or capitals in every line) :)

Regards

Ron

"nospam" <n@ntspam.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
Ok, I asked this question before and I also looked at the book "First Look
at ASP.NET 2.0"
I also read Paul wilson's web page explanation. HOWEVER......

The book and that web page talks about partial types and that IF you have a
Extends keyword, I think, before the class name AND the same Namespace,

.NET
will automatically compile the rest of the class that is located in

another
file.

However, I want to know just exactly how is .NET going to find that

OTHER file......

There is the .aspx page that has the complieswith attribute and some other attribute that can as before look for the CodeBehind file.

However, just exactly how does .NET find the other FILE????????

Does it search first and READ every single FILE in the same directory and work it's way out to the other files within the application to find a

class
name and namespace that matches?


Jul 21 '05 #9
> However, I want to know just exactly how is .NET going to find that OTHER
file......


It has to be part of the same project.

Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org

Jul 21 '05 #10
Cor
Hi Nospam,
It is one package in your build dll
Cor
Jul 21 '05 #11
Please post Whidbey related posts to the Whitbey NG's

http://communities.microsoft.com/new...idbey&slcid=us.

Willy.

"nospam" <n@ntspam.com> wrote in message news:O6**************@tk2msftngp13.phx.gbl...
Ok, I asked this question before and I also looked at the book "First Look
at ASP.NET 2.0"
I also read Paul wilson's web page explanation. HOWEVER......

The book and that web page talks about partial types and that IF you have a
Extends keyword, I think, before the class name AND the same Namespace, .NET
will automatically compile the rest of the class that is located in another
file.

However, I want to know just exactly how is .NET going to find that OTHER
file......

There is the .aspx page that has the complieswith attribute and some other
attribute that can as before look for the CodeBehind file.

However, just exactly how does .NET find the other FILE????????

Does it search first and READ every single FILE in the same directory and
work it's way out to the other files within the application to find a class
name and namespace that matches?

Jul 21 '05 #12
".NET" doesn't find them. The compilers / environment will find them and
compile them into one class. Rather simple.
-mike
MVP

"nospam" <n@ntspam.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
Ok, I asked this question before and I also looked at the book "First Look at ASP.NET 2.0"
I also read Paul wilson's web page explanation. HOWEVER......

The book and that web page talks about partial types and that IF you have a Extends keyword, I think, before the class name AND the same Namespace, ..NET will automatically compile the rest of the class that is located in another file.

However, I want to know just exactly how is .NET going to find that OTHER
file......

There is the .aspx page that has the complieswith attribute and some other
attribute that can as before look for the CodeBehind file.

However, just exactly how does .NET find the other FILE????????

Does it search first and READ every single FILE in the same directory and
work it's way out to the other files within the application to find a class name and namespace that matches?

Jul 21 '05 #13
All files that make up a partial type must be built at the same time, so
there's no lookup required.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"nospam" <n@ntspam.com> wrote in message
news:uu*************@TK2MSFTNGP10.phx.gbl...
"Build Code"? or do you mean, "Do I build code with VS.NET?"

All I want to know is how does .NET find #3.

"Cor" <no*@non.com> wrote in message
news:O9*************@TK2MSFTNGP11.phx.gbl...
Hi Nospam,
Do you use build code, made by Visual.studio Net?
Cor
(1) MyPartialType.aspx file <-- .aspx web page

(2) MyPartialType.aspx.cs file <-- standard code behind already referenced in the (1) above

(3) MyPartialTypeWhereAmI.aspx.cs <----- file that I don't know how ..NET knows where it's at????????



Jul 21 '05 #14
What about J.I.T. then?

Say if I hit F5(Refresh) within Internet Explorer for a single .aspx page
that has 2 .cs files as it's code behind files using compilesWith=
attribute, now what?

See what I am getting at? JIT is what I want to know....
"Eric Gunnerson [MS]" <er****@online.microsoft.com> wrote in message
news:eh**************@TK2MSFTNGP11.phx.gbl...
All files that make up a partial type must be built at the same time, so
there's no lookup required.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights. "nospam" <n@ntspam.com> wrote in message
news:uu*************@TK2MSFTNGP10.phx.gbl...
"Build Code"? or do you mean, "Do I build code with VS.NET?"

All I want to know is how does .NET find #3.

"Cor" <no*@non.com> wrote in message
news:O9*************@TK2MSFTNGP11.phx.gbl...
Hi Nospam,
Do you use build code, made by Visual.studio Net?
Cor

> (1) MyPartialType.aspx file <-- .aspx web page
>
> (2) MyPartialType.aspx.cs file <-- standard code behind already

referenced
> in the (1) above
>
> (3) MyPartialTypeWhereAmI.aspx.cs <----- file that I don't know how .NET > knows where it's at????????



Jul 21 '05 #15
Cor
Hi Nospan,

Aspx returns no server side aspx page and either aspx.cs but a created HTML
page with an extention ASPX.

Therefore client side debugging is not the same as serverside debugging.

I hope this helps a little bit.

Cor
Jul 21 '05 #16
Sorry that doesn't help.
Here is the question again.

What about J.I.T. then?

Say if I hit F5(Refresh) within Internet Explorer for a single .aspx page
that has 2 .cs files as it's code behind files using compilesWith=
attribute, now what?

See what I am getting at? JIT is what I want to know....

When I hit F5, how is .NET going to know where that OTHER
"MyPage_FIND_ME.aspx.cs" file is going to be
in other to fully compile the .aspx page..

Understand....there are 3 pages, 1 aspx page, and 2 .cs pages


"Cor" <no*@non.com> wrote in message
news:e0**************@tk2msftngp13.phx.gbl...
Hi Nospan,

Aspx returns no server side aspx page and either aspx.cs but a created HTML page with an extention ASPX.

Therefore client side debugging is not the same as serverside debugging.

I hope this helps a little bit.

Cor

Jul 21 '05 #17
The compiler looks for them when it recompiles (if it's working for you).

And what JIT are you talking about? By itself, J.I.T. means "just in time".
The JIT compiler? That acts upon the compiled CS (MSIL), and happens at a
much later stage.
-mike
MVP

"nospam" <n@ntspam.com> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...
Sorry that doesn't help.
Here is the question again.

What about J.I.T. then?

Say if I hit F5(Refresh) within Internet Explorer for a single .aspx page
that has 2 .cs files as it's code behind files using compilesWith=
attribute, now what?

See what I am getting at? JIT is what I want to know....

When I hit F5, how is .NET going to know where that OTHER
"MyPage_FIND_ME.aspx.cs" file is going to be
in other to fully compile the .aspx page..

Understand....there are 3 pages, 1 aspx page, and 2 .cs pages


"Cor" <no*@non.com> wrote in message
news:e0**************@tk2msftngp13.phx.gbl...
Hi Nospan,

Aspx returns no server side aspx page and either aspx.cs but a created

HTML
page with an extention ASPX.

Therefore client side debugging is not the same as serverside debugging.

I hope this helps a little bit.

Cor


Jul 21 '05 #18
When you hit the .aspx page the FIRST time, it's JIT'ed, right? Compiled
right?

That's what I am talking about. I got 3 files, 1 .aspx and 2 .cs files that
make up the code behind for that single .aspx page.

Understand now?

I don't see why people are so confused on what I am asking. It's real
simple.

A single .aspx and single code behind page is NOW a single .aspx page and
TWO code behind pages.

What's so difficult on that one???
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
The compiler looks for them when it recompiles (if it's working for you).

And what JIT are you talking about? By itself, J.I.T. means "just in time". The JIT compiler? That acts upon the compiled CS (MSIL), and happens at a
much later stage.
-mike
MVP

"nospam" <n@ntspam.com> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...
Sorry that doesn't help.
Here is the question again.

What about J.I.T. then?

Say if I hit F5(Refresh) within Internet Explorer for a single .aspx page that has 2 .cs files as it's code behind files using compilesWith=
attribute, now what?

See what I am getting at? JIT is what I want to know....

When I hit F5, how is .NET going to know where that OTHER
"MyPage_FIND_ME.aspx.cs" file is going to be
in other to fully compile the .aspx page..

Understand....there are 3 pages, 1 aspx page, and 2 .cs pages


"Cor" <no*@non.com> wrote in message
news:e0**************@tk2msftngp13.phx.gbl...
Hi Nospan,

Aspx returns no server side aspx page and either aspx.cs but a created

HTML
page with an extention ASPX.

Therefore client side debugging is not the same as serverside debugging.
I hope this helps a little bit.

Cor



Jul 21 '05 #19
Thanks, HOWEVER it doesn't seem to answer the question
Untitled.aspx
Untitled.aspx.1.cs
Untitled.aspx.2.cs

These three files must be used together to make Untitled.aspx page work via
JIT when the User first hits Internet Explorer 6.0 on your browser

YES, NO, does anyone understand what I am asking?????????

"Steve - DND" <ng@digitalnothing.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"nospam" <n@ntspam.com> wrote in message
news:OB**************@TK2MSFTNGP12.phx.gbl...
What about J.I.T. then?

See what I am getting at? JIT is what I want to know when the users hit

the
.aspx page for the first time....

Say if I hit F5(Refresh) within Internet Explorer for a single .aspx page that has 2 .cs files as it's code behind files using compilesWith=
attribute, now what?


This article may answer your questions. It really brings to light the new
changes in ASP.Net, and how the new ASPX/code-behind model operates(it's
very different than the current).

http://tinyurl.com/swgc

Steve

Jul 21 '05 #20
nospam,
These three files must be used together to make Untitled.aspx page work via JIT when the User first hits Internet Explorer 6.0 on your browser Yes! these three files must be compiled together to form an assembly.

No! these three files are not JIT'd, the resultant assembly from the above
compilation is JIT'd to execute.

That's the way I understand ASP.NET works.
does anyone understand what I am asking????????? I believe you are asking how does ASP.NET know where to find the third file
to compile it into an assembly, which will subsequently be JIT'd. I don't
have an answer, however for my own edification I am curious as to how it
works...

Does the following article help?
http://msdn.microsoft.com/asp.net/wh...ompilation.asp

Or one of the articles on the following page?
http://msdn.microsoft.com/asp.net/whidbey/

Hope this helps
Jay

"nospam" <n@ntspam.com> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl... Thanks, HOWEVER it doesn't seem to answer the question
Untitled.aspx
Untitled.aspx.1.cs
Untitled.aspx.2.cs

These three files must be used together to make Untitled.aspx page work via JIT when the User first hits Internet Explorer 6.0 on your browser

YES, NO, does anyone understand what I am asking?????????

"Steve - DND" <ng@digitalnothing.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"nospam" <n@ntspam.com> wrote in message
news:OB**************@TK2MSFTNGP12.phx.gbl...
What about J.I.T. then?

See what I am getting at? JIT is what I want to know when the users
hit
the
.aspx page for the first time....

Say if I hit F5(Refresh) within Internet Explorer for a single .aspx page that has 2 .cs files as it's code behind files using compilesWith=
attribute, now what?


This article may answer your questions. It really brings to light the

new changes in ASP.Net, and how the new ASPX/code-behind model operates(it's
very different than the current).

http://tinyurl.com/swgc

Steve


Jul 21 '05 #21
> Does the following article help?
http://msdn.microsoft.com/asp.net/wh...ompilation.asp
Or one of the articles on the following page?
http://msdn.microsoft.com/asp.net/whidbey/

No these links have already been given and they didn't answer my question.


"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl... nospam,
These three files must be used together to make Untitled.aspx page work via
JIT when the User first hits Internet Explorer 6.0 on your browser

Yes! these three files must be compiled together to form an assembly.

No! these three files are not JIT'd, the resultant assembly from the above
compilation is JIT'd to execute.

That's the way I understand ASP.NET works.
does anyone understand what I am asking?????????

I believe you are asking how does ASP.NET know where to find the third

file to compile it into an assembly, which will subsequently be JIT'd. I don't
have an answer, however for my own edification I am curious as to how it
works...

Does the following article help?
http://msdn.microsoft.com/asp.net/wh...ompilation.asp
Or one of the articles on the following page?
http://msdn.microsoft.com/asp.net/whidbey/

Hope this helps
Jay

"nospam" <n@ntspam.com> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl...
Thanks, HOWEVER it doesn't seem to answer the question
Untitled.aspx
Untitled.aspx.1.cs
Untitled.aspx.2.cs

These three files must be used together to make Untitled.aspx page work

via
JIT when the User first hits Internet Explorer 6.0 on your browser

YES, NO, does anyone understand what I am asking?????????

"Steve - DND" <ng@digitalnothing.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

"nospam" <n@ntspam.com> wrote in message
news:OB**************@TK2MSFTNGP12.phx.gbl...
> What about J.I.T. then?
>
> See what I am getting at? JIT is what I want to know when the users hit the
> .aspx page for the first time....
>
> Say if I hit F5(Refresh) within Internet Explorer for a single .aspx

page
> that has 2 .cs files as it's code behind files using compilesWith=
> attribute, now what?

This article may answer your questions. It really brings to light the new changes in ASP.Net, and how the new ASPX/code-behind model operates(it's very different than the current).

http://tinyurl.com/swgc

Steve



Jul 21 '05 #22

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

Similar topics

21
by: nospam | last post by:
Ok, I asked this question before and I also looked at the book "First Look at ASP.NET 2.0" I also read Paul wilson's web page explanation. HOWEVER...... The book and that web page talks about...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.