Multiple Partial class file in aspx code behind file?

  • Thread starter Thread starter Hiten
  • Start date Start date
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??
 
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
 
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
 
Back
Top