Adding Controls Dynamically

P

Prabhu Ram Prasath

Dear Friend,

Does anyone could answer this simple problem!!!

I have a textbox, submit button and a panel (all webserver
controls) in a web page.

After entering some text in the textbox and pressing the
submit button, it will add the text into the panel as a
Hyperlink.

The code in the command button is
newCtrl = New WebControls.HyperLink
newCtrl.Text = textbox1.Text & "<BR>"
newCtrl.ID = textbox1.Text
panel1.Controls.Add(newCtrl)

The procedure is running well, but the next time I press
the button, the old hyperlink gets destroyed and only the
new hyperlink gets displayed in the panel.

Any Idea!!!

Regards,
Prabhu Ram Prasath
 
W

Wesam

Probably the insertion happens by posting data (the newly inserted link) to
the WEB server, and thus it is added; likewise when you add another one, the
list (the panel) is emptied as if you'd started the application for the
first time and thus you lose the old data and only see the new ones (the new
link).

We$am
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top