Multiple Partial class file in aspx code behind file?

H

Hiten

Is it possible to have more code behind file but that file will have
same class in way of partial class,
Default

Structure I
--------------
Homepage.aspx
+ Homepage.aspx.cs (this .cs file will have "Homepage" class
which is partial)

Can we have more file in code behind which has partial implementation
of the same Class

Structure II
----------------
Homepage.aspx
+ Homepage1.aspx.cs (this .cs file will have "Homepage" class
which is partial)
+ Homepage2.aspx.cs (this .cs file will have "Homepage" class
which is partial)
+ Homepage3.aspx.cs (this .cs file will have "Homepage" class
which is partial)

Is above Structure II is possible in Asp.Net??
 
G

Guest

Hiten,
This is not really what Partial Classes are designed for in ASP.NET - they
are really for keeping the Designer - generated control code separate from
your Page class' business logic code.

It looks like what you really are after is a Base Page class that other Page
classes derive from - inheritance.
Peter
 
H

Hiten

Hi Peter

I agree with you but lets have example if i have ASPX page it has so
many controls on page and according to that there are many code at code
behind now to divide these codes in files by keeping same class we can
go for partial class and achieve that,
So my question is that only how do I do that?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top