When to use CreateChildControls() vs. embedding in the ASPX

Posted by Kelly French on Stack Overflow See other posts from Stack Overflow or by Kelly French
Published on 2010-06-03T14:30:57Z Indexed on 2010/06/03 14:34 UTC
Read the original article Hit count: 278

I'm developing a webpart for SharePoint 2007 and have seen several posts that advise to do all the creation of controls in the code-behind. I'm transitioning from Java J2EE development so I don't have the platform history of .Net/ASP/etc.

In other places it shows how you can do the same thing by embedding the control definition into the asp page with tags

My question is this:

What is the rule governing where to implement controls? Has this rule changed recently, ASP vs ASP.Net or ASP.Net MVC maybe? Is this advice limited to SharePoint development?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET