Dynamically Added TextBoxes

K

KJ

Is there anyway to get the value of a dynamically added textbox that
was added after OnInit in Page_Load on Postback?


Page_Load

Dim tb As New Textbox

page.controls.add(tb)
tb.text = "ASP.NET"
End Sub


But1_Click

label1.text = tb.text


End Sub


My problem is tb.text is blank ("")

Is there anyway to save the value between postback?

Thanks
 
K

Kishor

Hi KJ,

one way to do this is to save the value in the textbox into the viewstate.

kishor.
 

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,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top