fcallery Posted March 7, 2005 Posted March 7, 2005 Hi guys. Mi Asp.Net page creates some textboxes on load depending from records it retrieves from a db. Here is a simplified version (actually I used more control even some of Microsoft.Web.Ui.WebControls assembly): Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then dbConn.ConnectionString = Application("ConnectionString") dbConn.Open() Dim cmd As New SqlCommand("select content from textboxes where page = 'home' order by presentation_order", dbConn) Dim myReader As SqlDataReader myReader = cmd.ExecuteReader() While myReader.Read() counter = counter + 1 Dim txtContent As New TextBox() txtContent.ID = "txtContent" & counter txtContent.TextMode = TextBoxMode.MultiLine txtContent.Text = myReader.GetString(0) txtContent.Height = a.Percentage(98) txtContent.Width = a.Percentage(100) MyBase.Controls.Add(txtContent) End While myReader.Close() dbConn.Close() End Sub I'd like to know how can I retrieve data from one of the textboxes, and how can I save modified data from all of them into the database. I need to do it by pressing a button, but I don't know how I can. Please help me. Thanks a lot. Fabrizio Quote
Leaders snarfblam Posted March 7, 2005 Leaders Posted March 7, 2005 If you store all the textboxes in an array or collection so you have references to them, then you should be able to access their .Text property, no? Quote [sIGPIC]e[/sIGPIC]
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.