Home All Groups Group Topic Archive Search About

What is .Net equivilent of Fieldset/Legend

Author
11 May 2005 6:56 PM
Harry Keck
I want to set  up my UI to display a titled box around a group of controls,
like an html Fieldset with a Legend does, but I would like to do it entirely
with a ASP.Net controls.  Is there a way to do this?  I can put a panel
around a group of controls, but I do not know how to get text to display like
a legend does.

Author
12 May 2005 3:09 PM
clintonG
AFIK none of the native controls emit fieldset and legend HTML elements.
You'd have to override the rendering method(s) of the native control(s) or
develop your own controls. Nice choice huh ;-)

<%= Clinton Gallagher
         METROmilwaukee (sm) "A Regional Information Service"
         NET csgallagher AT metromilwaukee.com
         URL http://metromilwaukee.com/
         URL http://clintongallagher.metromilwaukee.com/




Show quoteHide quote
"Harry Keck" <HarryK***@discussions.microsoft.com> wrote in message
news:75361480-845E-4907-9652-E22358E42761@microsoft.com...
>I want to set  up my UI to display a titled box around a group of controls,
> like an html Fieldset with a Legend does, but I would like to do it
> entirely
> with a ASP.Net controls.  Is there a way to do this?  I can put a panel
> around a group of controls, but I do not know how to get text to display
> like
> a legend does.
Author
14 May 2005 6:45 AM
Teemu Keiski
If you want to access it programmatically you can just try using it as an
HTML control

<fieldset ID="Group1" runat="server">
....
</fieldset>

The code-behind type would be
System.Web.UI.HtmlControls.HtmlContainerControl (or equivalent from the
hierarchy)

As was said, rendering is one approach as well.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU


Show quoteHide quote
"Harry Keck" <HarryK***@discussions.microsoft.com> wrote in message
news:75361480-845E-4907-9652-E22358E42761@microsoft.com...
>I want to set  up my UI to display a titled box around a group of controls,
> like an html Fieldset with a Legend does, but I would like to do it
> entirely
> with a ASP.Net controls.  Is there a way to do this?  I can put a panel
> around a group of controls, but I do not know how to get text to display
> like
> a legend does.