Server Controls/User Controls best practices

Last post 11-17-2009 4:00 AM by Allen Chen – MSFT. 8 replies.

Sort Posts:

  • Server Controls/User Controls best practices

    11-12-2009, 5:46 PM
    • Member
      12 point Member
    • xavierx
    • Member since 07-25-2008, 5:13 PM
    • Posts 14

    I am trying to create a library of controls to be used across my business apps. I just want it in a central location to make maintenance easier and just include the controls' references in the various projects when necessary.

     

    I am not sure what the best approach is whether i create them all as individual server controls, compile and thus have multiple projects, one for each control...OR..

    Do i create one project, include a bunch of user controls/server controls and then compile it as a single assembly and distrubute it across all the applications that way?

     

    Or perhaps i'm totally way off in my thinking. Just thought i'd throw it out there and hopefully get some insight. Thanks for anyones time.

  • Re: Server Controls/User Controls best practices

    11-12-2009, 7:20 PM

    I'd put them all into one assembly so you don't have a lot of overhead loading multiple assemblies.  The assemblies are usually pretty small compared to the size of other resources. 

    As far as individual controls are concerned you probably want to put those into seperate files, as opposed to having multiple controls in one file so that you can work on them individually which is important if you have source control.

  • Re: Server Controls/User Controls best practices

    11-13-2009, 12:37 AM
    • Contributor
      2,068 point Contributor
    • jkirkerx
    • Member since 12-07-2007, 7:52 AM
    • Huntington Beach CA
    • Posts 476

    I think what is more important is to organize multiple control projects. 

    I have a control that is used in every other control, so I call it Common. That way I can go back to the core of the controls and make one change, that updates throughout all the other controls that depend on it.

    I like using multiple controls, that way I can sell core controls to customers that have the basic functionaility, and controls that prepare  my unique data to feed to the core controls, that process it, and return unified values.

    Just remeber to clean and build when working with multiple controls.

    FYI,

    I pack many controls into a single control project. Some projects have up to 30 or 40 controls inside it. But there stored in individual files inside. I also embed all the artwork as well, everything that is needed to produce the control.

    I lost control of all the artwork like icons and buttons years ago, so now there all embedded.





  • Re: Server Controls/User Controls best practices

    11-13-2009, 7:43 PM
    • Member
      12 point Member
    • xavierx
    • Member since 07-25-2008, 5:13 PM
    • Posts 14

    Thanks for the suggestions guys.

    So is this right then in what I am doing? I am going to create a new ASP.NET web project, and then create all my user controls there as separate ascx files, compile and distrubute assembly across applications?

     

    Does that sound like a good method? Ideally I'm just trying to have to so that if i make changes/updates, I open this control solution, modify what i need, recompile, and since all the projects will reference the assembly in a central location, I change it once, it changes for all!

  • Re: Server Controls/User Controls best practices

    11-16-2009, 2:26 AM

    Hi,

    What you do is right except that Custom control is better to suit this scenario. Please refer to the following article for comparison and more details:

    http://support.microsoft.com/kb/893667/en-us 

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Server Controls/User Controls best practices

    11-16-2009, 2:38 AM
    • Member
      12 point Member
    • xavierx
    • Member since 07-25-2008, 5:13 PM
    • Posts 14

    I think you mis understood my question. I'm just checking for how i should set up my assembly for making centralized controls. like multiple controls 

  • Re: Server Controls/User Controls best practices

    11-16-2009, 9:54 PM

    Hmm.. Looks like your question is regarding revision control instead of custom control of ASP.NET. Please refer to the following documentation to choose a software to do so (Try Team Foundation Server of Microsoft if you like):

    http://en.wikipedia.org/wiki/Comparison_of_revision_control_software 

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Server Controls/User Controls best practices

    11-17-2009, 3:32 AM
    • Member
      12 point Member
    • xavierx
    • Member since 07-25-2008, 5:13 PM
    • Posts 14

    lol no, I know what source control is, its not that. its ok thanks anyway 

  • Re: Server Controls/User Controls best practices

    11-17-2009, 4:00 AM

    xavierx:

    Does that sound like a good method? Ideally I'm just trying to have to so that if i make changes/updates, I open this control solution, modify what i need, recompile, and since all the projects will reference the assembly in a central location, I change it once, it changes for all!

     

    Is my understanding correct that you'd like to put all your controls in one assembly and put the built assembly in a share folder that other machines can access to add reference to it? Could you tell me what are you worrying about by this approach?

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (9 items)