locked
Recommended standards for Custom Server Control Creation in ASP.NET 4.0 RRS feed

  • Question

  • User-686681379 posted

    Like a lot of developers, I have been using ASP.NET for quite a few years now and am quite comfortable with the nuances of creating web form apps. Over the last few months I have been working on creating a custom server control library that uses ASP.NET, Javascript, AJAX, JQuery as well as embedded resources smoothly. While I have them working nicely and seemlessly together on my demo pages, I would like to find a site/article/book with the latest suggested methods/standards for creating custom server controls using various technologies to verify I am doing them the right way.

    Now if the fact is it hasn't changed at all since ASP.NET 2.0 and all the books/articles since 2007 are just as relevent that is great. It just seems that some things such as managing view state and when to use client script such as JQuery and AJAX versus relying on Update Panels have been evolving. Fortunately the controls I am creating don't have too much state issues, so I am having fun creating interfaces that are efficient (well reponsive anyways) with JQuery and not using the AJAX Toolkit, which I keep finding issues with.

    While not interested in debating the tools I am using (you don't dare mention using ASP.NET on a Javascript/JQuery chatroom) I would welcome anyone who could point me to a definative location for what is the latest recommendations for creating Custom Server Control standards. I have no problem reworking what I need to come into compliance.

    Any suggestions would be appreciated.

     

    Saturday, May 21, 2011 10:32 PM

Answers

  • User-2131369213 posted

     

    Not that much has changed but if you are looking for a good .net 4.0 book with several chapters focussing on server controls: http://ow.ly/504Ak

    you can also check this msdn page on server controls: http://msdn.microsoft.com/en-us/library/zt27tfhy.aspx

    on the msdn page you can filter on framework wich will allow you to see the differences.

    hope this helps

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 22, 2011 4:17 AM

All replies

  • User-2131369213 posted

     

    Not that much has changed but if you are looking for a good .net 4.0 book with several chapters focussing on server controls: http://ow.ly/504Ak

    you can also check this msdn page on server controls: http://msdn.microsoft.com/en-us/library/zt27tfhy.aspx

    on the msdn page you can filter on framework wich will allow you to see the differences.

    hope this helps

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 22, 2011 4:17 AM
  • User-686681379 posted

    Helped a lot thanks. In looking through the site you mentioned, which I had used a while back when starting to work with CompositeCobntrols, and found it very helpful.

    One of my major questions, and one I have found a ton of debate about. Is the use of Javascript/JQuery with AJAX calls, versus doing code behind with partial postbacks.  For instance there is a section on creating templated controls. I have been also working on getting comfortable in JQuery and have been looking into using the templating in JQuery which is pretty slick.  It seems like it takes less code even in some cases, and definately feels like I am getting better UI performance, without the hassle of dealing with postback fallout and timing.

    Nowadays, is it acceptable for server controls to handle most interaction with Javascript/JQuery/AJAX? I have the code embedded with external files and namespaces as suggested. The only downside I see is the code can be seen on the local machine if the user wants to hunt it down.

    I guess my main question am I wrong to handle most tasks with JS versus behind code? I still can expose events for the developers using the controls no problem, and make sure they work correctly with postbacks no problem.

    Thanks again for suggestions/opinions.

     

    Sunday, May 22, 2011 5:59 PM