[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Dynamically Adding HyperLink Control

christopher pragash

12/26/2002 9:32:00 PM

Hello All,

My aspx page loads two custom server controls. One for the Navigation and
other for the body. The navigation control is actually a set of HyperLink
controls which I programmatically manipulate (changing text, URL's etc)
before loading it into the page.

I would like to dynamically add a new HyperLink control and delete an
existing one. Is this possible. I believe the RenderControl is used for this
purpose, but how about if I want to add a new Hyperlink Control in the
middle of an existing set of Hyperlink controls...

Is this possible...any sample code could be of great help.

thanks,
chris


1 Answer

Victor Garcia Aprea [MVP]

12/27/2002 6:44:00 AM

0

Hi Christopher,

Your navigation custom control is holding all its child controls (its
HyperLink) in its Controls collection. You can use the Add and Remove
methods of the Controls collection to add and remove any controls you want.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.


"Christopher Pragash" <chrispragash@hotmail.com> wrote in message
news:enVzA4RrCHA.1848@TK2MSFTNGP09...
> Hello All,
>
> My aspx page loads two custom server controls. One for the Navigation and
> other for the body. The navigation control is actually a set of HyperLink
> controls which I programmatically manipulate (changing text, URL's etc)
> before loading it into the page.
>
> I would like to dynamically add a new HyperLink control and delete an
> existing one. Is this possible. I believe the RenderControl is used for
this
> purpose, but how about if I want to add a new Hyperlink Control in the
> middle of an existing set of Hyperlink controls...
>
> Is this possible...any sample code could be of great help.
>
> thanks,
> chris
>
>