Custom Server Control with Panel --> how?

G

Gönen EREN

Hi ,
I want to built a custom server control which has:
* a panel
* a button which sets the visiblity of the panel true or false

and finally a want to add controls in the custom control
(label,datagrid,...) in the aspx page just like an asp:panel

i have a very small experience in building server controls so if you have
any ideas or sample code please send it
thanks for your help.

Gönen EREN
(e-mail address removed)
 
T

Teemu Keiski

You may want to look at so-called composite controls.Basically it is a
control that creates its child controls on its CreateChildControls method
and also implements INamingContainer interface Check examples at these
newsgroups and also provided resources.

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 
G

Gönen EREN

Will i able to use it like
<CustomControl:CustomPanel id="xxx" runat=server [...]>
Adding here whatever i want to be displayed in the custom panel
including datagrid label ...
</CustomControl:CustomPanel>
 
T

Teemu Keiski

Sure, in that case control is specified using ParseChildren attribute that
it maps the inner content as child controls not to its properties (as is
default for WebControl)

All these things are discussed in MSDN documentation about building server
controls and in MSPress's book "Developing ASP.NET Server Controls and
Components". You might also want to check Building Controls forum at ASP.NET
Forums, www.asp.net/forums

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top