takesoln Posted March 15, 2004 Posted March 15, 2004 Hi ... I am creating a Textbox within a place holder, on a Button_Click Event ... i.e. At runtime ... But, i am not able to get the value of the text box, on PostBack ... I know that the control has to be re-created every time the page loads, but i don't know how to manage state for the dynamically created control... My code is, Private Sub Cash_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cash.Click Dim txtbox As New TextBox() Dim btnOne As New Button() txtbox.Width = Unit.Pixel(100) txtbox.Height = Unit.Pixel(20) btnOne.Text = "buttonClear" PlaceHolder1.Controls.Add(txtbox) PlaceHolder1.Controls.Add(btnOne) 'End If End Sub I would appreciate it if you could suggest how i can manage this control thru my code ... If possible, give me some sample code too ... Thanks ... Quote
Moderators Robby Posted March 15, 2004 Moderators Posted March 15, 2004 In your form load event do the the following... If Not IsPostBack Then CallMyCreateControlRoutine() End If Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.