C# – SharePoint AJAX C# web part – visual layout of UpdatePanel controls

ajax, c++, sharepoint, user-interface, web-parts

I'm creating a SharePoint web part in C# that is using an UpdatePanel for some AJAX magic. Everything is working fine, but I'd like to know how to lay out my controls visually (without using SharePoint Designer). I just have two dropdownlists, some labels, a button, and a textbox. I am creating them within the overridden CreateChildControls. Thanks!

Best Solution

there are a couple of ways you can lay them out. you can add a Table object and add rows, cells, etc. and add your controls to the cells.

Alternately, you can override the RenderContents method and output HTML directly to the write that is passed in as a parameter. If you do this method (its probably less work and more efficient then using the Table objects), you should use a StringBuilder to build your HTML then output the results to the writer. This method should gain you some performance.

Sadly, there is no visual WYSIWIG editor for this method.