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

Partial classes

P: n/a
Hi Everyone,

we're currently developing an web-app for insurance company. We've got a
long form-flows and view-classes (MVC) of about 2000 lines of code. Is there
any possibility to split code-behind classes into multiple files using
partial classes? It would be helpfull to balance work on multiple developers
working on same subject.
I've already got it done in DLL-Projects (SQL-Helper, Builders, .... ) but
how to do it in web-projects?

Thanks for help!
Sebastian

Aug 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In the same way as you do it for the dlls.

An example:
public partial class MasterGrid : System.Web.UI.MasterPage

{

....

}
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Sebastian" <Se*******@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.com...
Hi Everyone,

we're currently developing an web-app for insurance company. We've got a
long form-flows and view-classes (MVC) of about 2000 lines of code. Is
there
any possibility to split code-behind classes into multiple files using
partial classes? It would be helpfull to balance work on multiple
developers
working on same subject.
I've already got it done in DLL-Projects (SQL-Helper, Builders, .... ) but
how to do it in web-projects?

Thanks for help!
Sebastian

Aug 28 '06 #2

P: n/a
I try to compile a web projects with one aspx file and multiple code-behind
classes. In page-directive you can use only ONE class (file, inherits, ...).
There is no more web-proj. file in VS 2005 if you're using the new model (not
this known from VS 2003).

If I'm putting events for buttons in separate (partial) class, I get an
error that compiler couldn't find the signatures (so it doesn't put together
the partial classes by compiling the projects).

My Example (should describe the prob better), my files:

- somePage.aspx (<%@ Page AutoEventWireup="true" CodeFile="somePage.aspx.cs"
Inherits="SomePage" Language="C#" %>)

- somePage.aspx.cs (public partial class SomePage)
- somePageButtonEvents.aspx.cs (public partial class SomePage)
- somePageHelpers.aspx.cs (public partial class SomePage)

somePageButtonEvents.aspx.cs - contains events for buttons/radios, a so on,
on the page
somePageHelpers.aspx.cs - contains methods and events for ex. filling
dropdowns a so on.

By compiling the app I get an error "Couldn't find events for buttons,
drop-downs, ..."

Has anyone an example for such scenario?

Sebastian
"Eliyahu Goldin" wrote:
In the same way as you do it for the dlls.

An example:
public partial class MasterGrid : System.Web.UI.MasterPage

{

....

}
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Sebastian" <Se*******@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.com...
Hi Everyone,

we're currently developing an web-app for insurance company. We've got a
long form-flows and view-classes (MVC) of about 2000 lines of code. Is
there
any possibility to split code-behind classes into multiple files using
partial classes? It would be helpfull to balance work on multiple
developers
working on same subject.
I've already got it done in DLL-Projects (SQL-Helper, Builders, .... ) but
how to do it in web-projects?

Thanks for help!
Sebastian


Aug 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.