16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1020 Part IX: Maintaining a Server in Windows SharePoint Services<br />

code shows a basic RenderWebPart implementation that makes sure the TextBox <strong>and</strong><br />

Button controls are rendered.<br />

protected override void RenderWebPart(HtmlTextWriter output)<br />

{<br />

EnsureChildControls();<br />

RenderChildren(output);<br />

}<br />

F37xr03.bmp<br />

Figure 37-3 A Web Part with child controls<br />

This concludes the section about creating child controls on a Web Part. A Web Part<br />

is a special kind of ASP.NET Web control, so if you need more information about this<br />

topic you can read more on developing ASP.NET Web controls on MSDN.<br />

Web Part Caching<br />

One of the factors that separate a great Web Part from an average Web Part is performance.<br />

You can enhance performance by caching data. You should not use the<br />

ASP.NET Session state in Web Parts because the current implementation of the Safe-<br />

Mode parser does not allow Session state to be defined at the page level as is possible<br />

with the ASP.NET parser. This means the administrator can enable Session state<br />

for all Web Part Pages or for none of them. Enabling Session state for all pages<br />

degrades server performance.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!