Click here to Skip to main content
15,888,113 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionCreating MSI package Pin
NICE TO MEET10-Feb-09 1:30
NICE TO MEET10-Feb-09 1:30 
QuestionRe: Creating MSI package Pin
Vasudevan Deepak Kumar10-Feb-09 3:03
Vasudevan Deepak Kumar10-Feb-09 3:03 
AnswerRe: Creating MSI package Pin
NICE TO MEET10-Feb-09 16:29
NICE TO MEET10-Feb-09 16:29 
QuestionCSS deployment issue Pin
ShreyaSingh319-Feb-09 20:25
ShreyaSingh319-Feb-09 20:25 
AnswerRe: CSS deployment issue Pin
Vasudevan Deepak Kumar10-Feb-09 3:03
Vasudevan Deepak Kumar10-Feb-09 3:03 
QuestionSpace between line Pin
puwanes9-Feb-09 19:46
puwanes9-Feb-09 19:46 
AnswerRe: Space between line Pin
EliottA10-Feb-09 3:08
EliottA10-Feb-09 3:08 
QuestionIs using a User Control Embedded Class a good practice? Pin
MacSpudster9-Feb-09 8:36
professionalMacSpudster9-Feb-09 8:36 
First: What Is a User-Control Embedded Class?
A User-Control Embedded Class is a user-control with no U.I. but has a separate class (such as public class MyEmbeddedClass() { }) located just below the user-control's partial class, and the class is just like any other class, having properties, private and static methods (mostly static), etc., such that when the user-control is placed on a web page, only that webpage wherein the user-control is placed on can now call MyEmbeddedClass() methods.
And, in a web app that compiles on the fly, only that web page is impacted when MyEmbeddedClass (located in the user-class'es code-behind) is changed.

Usage:
Create a user control called classMyStuffcontrol.ascx, then add a SEPARATE class to it as follows

public class MyStuff(){

}


We'll pretend it is a decent sized class, having 12 or so static methods (functions), around 500 lines of code.

Focus #1: Now, this user control is needed on about 7 web pages and 3 other user controls.

1) Does this mean, in Focus #1, that there would be 10 instances of the class Mystuff (within classMyStuffcontrol.ascx), even though there are only static methods?

Focus #2: Now, one of those pages which already uses one of the user controls that has MyStuff() in use also needs access to the class MyStuff, so I add the MyStuffControl to the web page as well..

2) Does this mean that there are multiple instances of the class MyStuff for that webpage and user-control, both using classMyStuffcontrol.ascx, would there be 2 instances of the class MyStuff instantiated even though there are only static methods?


Now, before ya start asking "why", here's why I do this:
- some 3 years ago I was asked to create a single user control that did tons of stuff; no extra code files would be accepted. So I coded the whole thing in a single UI page and corresponding code-behind page (those 2 files were acceptable). The code behind had 6 separate classes which focused on a given set of tasks.

Soon after this, a different client asked for the same thing once they became aware that I had done something like this already. From there, it kept snowballing; client after client wanted similar output (1 or 2 files containing all the code for a big solution.

After 6 months, I set aside this 'practice', but a few months later started using it wherein only a single class was associated to a single user-control. Now, there are still the universal / web-app-wide classes I used, but alot of the other classes were specific to a given area, and/or not used as much as a webapp-wide class would be used.

What this permitted was my ability to change the user-control embedded class, affecting only those web pages (wherein an on-the-fly compile took care of it) versus a web-app restart (such as what occurs when the web.config file is changed).

Have I described this enough such that you would be able to provide feedback as to its usefulness and/or practicality? Specifically, am I asking for trouble down the line or are user-control embedded classes, when used in moderation, a reasonable solution?

Thx.

ASP ~ Apple Simply Performs

AnswerRe: Is using a User Control Embedded Class a good practice? Pin
Jon Rista9-Feb-09 12:38
Jon Rista9-Feb-09 12:38 
GeneralRe: Is using a User Control Embedded Class a good practice? Pin
MacSpudster10-Feb-09 11:03
professionalMacSpudster10-Feb-09 11:03 
QuestionHow to set a specific NumberFormat for a whole project Pin
lugu239-Feb-09 3:52
lugu239-Feb-09 3:52 
AnswerRe: How to set a specific NumberFormat for a whole project Pin
Jon Rista9-Feb-09 12:34
Jon Rista9-Feb-09 12:34 
GeneralRe: How to set a specific NumberFormat for a whole project Pin
lugu239-Feb-09 19:40
lugu239-Feb-09 19:40 
Questionhow to specify the T Generic type for a class at runtime or from parameter [modified] Pin
Feras Mazen Taleb8-Feb-09 18:17
Feras Mazen Taleb8-Feb-09 18:17 
AnswerRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Dave Kreskowiak9-Feb-09 2:03
mveDave Kreskowiak9-Feb-09 2:03 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
supercat99-Feb-09 8:21
supercat99-Feb-09 8:21 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Feras Mazen Taleb9-Feb-09 10:04
Feras Mazen Taleb9-Feb-09 10:04 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Dave Kreskowiak9-Feb-09 12:03
mveDave Kreskowiak9-Feb-09 12:03 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Feras Mazen Taleb9-Feb-09 20:02
Feras Mazen Taleb9-Feb-09 20:02 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Curtis Schlak.25-Feb-09 8:34
Curtis Schlak.25-Feb-09 8:34 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Feras Mazen Taleb25-Feb-09 10:16
Feras Mazen Taleb25-Feb-09 10:16 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Curtis Schlak.25-Feb-09 13:28
Curtis Schlak.25-Feb-09 13:28 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Feras Mazen Taleb26-Feb-09 8:01
Feras Mazen Taleb26-Feb-09 8:01 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Curtis Schlak.26-Feb-09 8:27
Curtis Schlak.26-Feb-09 8:27 
GeneralRe: how to specify the T Generic type for a class at runtime or from parameter Pin
Feras Mazen Taleb26-Feb-09 8:41
Feras Mazen Taleb26-Feb-09 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.