ASP.NET Wrapper Panel

This is a useful control that works like a masterpage but is more lightweight. You can use this control as a wrapper for commonly used html snippets in your code.

 

This is the code file for the control.

 

You would use it as follows:

The result would be:

Now you can focus on what’s important and not worry about the wrapping html code.

Also using the TemplateInstance.Single attribute, you can access controls within your wrapper just as you would without it. If you didn’t use it, you willl have to access them using the FindControl function on wrapper control.

Advertisement
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.