Hello Nick,
I'm not quite sure about what your wrap control will look like(for UI
appearance), however, for building such a custom control through available
ASP.NET control development features, here are some suggestions:
1. I think ascx usercontrol is not suitable here, and a custom web server
control is preferred.
2. As what you need is the following like control, the control itself can
contain discretionary child content(normal html or other server controls):
=========
<my:RoundedCornerBox id=foo runat=server>
Content1
Content2
</my:RoundedCornerBox>
===========
and after rendering, all the child content will be also wrapped in
container html set such as
===========
<div>
child content rendering...
</div>
===========
Thus, I think a good choice is to use ASP.NET custom template control(just
like the LoginView control...) which can let you define a custom inner
template, and those child content in the template will always be rendered
within the container(you determined in your toplevel control's control
creation code logic).
Here are some MSDN reference and web article introduce developing custom
template control.
#Building Templated Custom ASP.NET Server Controls
http://msdn2.microsoft.com/en-us/library/aa478964.aspx
#Creating a Templated Control
http://www.samspublishing.com/articles/article.asp?p=101748&seqNum=7&rl=1
For your scenario, you can define a Template property for your custom wrap
control(which use to contain any content you want to include), then in your
control's main control creation codelogic, you first create the outside
wrapper html content(<div>, <table> or ...) and add the template instanced
sub controls into the outside wrapper. Also, you can use multi-templates if
necessary, it's quite flexible.
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.