473,769 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Partial classes

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
2 1429
In the same way as you do it for the dlls.

An example:
public partial class MasterGrid : System.Web.UI.M asterPage

{

....

}
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Sebastian" <Se*******@disc ussions.microso ft.comwrote in message
news:94******** *************** ***********@mic rosoft.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
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="someP age.aspx.cs"
Inherits="SomeP age" Language="C#" %>)

- somePage.aspx.c s (public partial class SomePage)
- somePageButtonE vents.aspx.cs (public partial class SomePage)
- somePageHelpers .aspx.cs (public partial class SomePage)

somePageButtonE vents.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.M asterPage

{

....

}
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Sebastian" <Se*******@disc ussions.microso ft.comwrote in message
news:94******** *************** ***********@mic rosoft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
2676
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the User first hits Internet Explorer 6.0 on your browser.
9
2534
by: Gomaw Beoyr | last post by:
Two question about the "partial classes" (in the next wersion of ..NET). Question 1 ========== Will partial classes (in the next version of C#) have to be declared "partial" in ALL places. I.e. do we have to need to write:
16
2652
by: pawel.pabich | last post by:
Hajo, I would like to have 2 my own partial classes. For example: Default.aspx.cs Default2.aspx.cs and they both will relate to Default.aspx page.
10
2445
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and load as a 3rd partial class. This would be handy so i can generate standard code into one of the partial classes, while having my custom code untouched
1
2636
by: Bishoy George | last post by:
In a web application using asp.net 2.0 All my classes are partial classes. - I noticed that partial class cannot be inherited... is that true? - I tried to remove the partial keyword , and I receieved this error Error 1 Missing partial modifier on declaration of type 'NagyResearch.Q_A.Q.QuestionnairePage'; another partial declaration of this type exists D:\Web Sites\Local
9
5789
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Data_List(); } }
5
1372
by: Sagar | last post by:
I am working on a migration project for a huge asp.net application now running in framwework 1.1 to dotnet 2.0 As a first step, I opened the .sln files of the project in VS.Net 2005. The Conversion wizard created partial classes off the existing classes. Is partial classes mandatory in VS.Net 2005 or can I still work without having to live with partial classes ?
2
2128
by: Peted | last post by:
Hi, im moving a project from vs2005 to vs 2008. is doing so i have come across a compiler error regarding partial classes that i dont understand if anyone can explain it to me please the orig defintion that compiles and runs fine in vs2005 is bellow......
10
1538
by: JDeats | last post by:
So I have a class that spans over two partial classes in code, here's an example (do not read much into this, the code is of no practical use, this is just a simple example of where my confusion occurs). // Inside SharedClassExample1.cs public partial class SharedClassExample { public List<stringBooksOnShelf { get; set; } public List<stringBooksOnDesk { get; set; }
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10222
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9999
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.