473,503 Members | 10,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datalist Textbox Values

Jon
Hello All,

I have a datalist whose itemtemplate contains a label and a textbox. The
label text is set on itemdatabound with the text, which is a question, from
the database column. Each question has an associated textbox. I want the user
to put a response to each question in the textbox, and click save. How do I
get the values from the textboxes? Bearing in mind that they all have dynamic
ids.

Thanks all,

Jon
Nov 19 '05 #1
2 2080
you might want to stay away from the dynamic ID's for the text boxes. If
you set the DataKeyField to, lets say a field called "ID" and the textbox is
named TextBox1...

then
dim i as int32 = 3 ' the item you are wanting
dim id as int32 = mylist.DataKeys(i) '' There's your ID
dim s as String =
ctype(mylist.items(i).FindControl("TextBox1"),Text Box).Text

make i a loop counter and you can interate through all of the items

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
Hello All,

I have a datalist whose itemtemplate contains a label and a textbox. The
label text is set on itemdatabound with the text, which is a question, from the database column. Each question has an associated textbox. I want the user to put a response to each question in the textbox, and click save. How do I get the values from the textboxes? Bearing in mind that they all have dynamic ids.

Thanks all,

Jon

Nov 19 '05 #2
Jon
David,

Thats's great. Thanks for the help.

Jon

"David Jessee" wrote:
you might want to stay away from the dynamic ID's for the text boxes. If
you set the DataKeyField to, lets say a field called "ID" and the textbox is
named TextBox1...

then
dim i as int32 = 3 ' the item you are wanting
dim id as int32 = mylist.DataKeys(i) '' There's your ID
dim s as String =
ctype(mylist.items(i).FindControl("TextBox1"),Text Box).Text

make i a loop counter and you can interate through all of the items

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
Hello All,

I have a datalist whose itemtemplate contains a label and a textbox. The
label text is set on itemdatabound with the text, which is a question,

from
the database column. Each question has an associated textbox. I want the

user
to put a response to each question in the textbox, and click save. How do

I
get the values from the textboxes? Bearing in mind that they all have

dynamic
ids.

Thanks all,

Jon


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4762
by: Kevin | last post by:
Hi all, I'm now very frustrated, I've been battling all of today to try and understand the datalist, editing, inserting, updating, etc, I have managed to get most of that sort of stuff...
0
1983
by: Mark | last post by:
Hi, I have a datalist that contains a textbox as well as a dropdown list. For each single row in the datalist the associated dropdown list can have at least one value What I would like to be...
0
1754
by: Alex | last post by:
Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Configuration Public Class Main : Inherits Page ...
0
1908
by: VbScripter | last post by:
In the code below, I have an editItemTemplate that will have to have a long list of ip's bound to it. The problem is that the lisbox is not seen by asp.net until after the datalist containing it...
8
653
by: MattB | last post by:
I think I'm close to making this work, but so far it does not. I have a datalist (id = "dlVFields") on a web form that has an item template with a textbox in it. The textbox id = "txtVerify"....
0
1440
by: Xiru | last post by:
I would like to retrieve the value from a DataList on postback. I can read the ItemIndex and values from a child TextBox but not cannot seem to find a way to read a databound item on the datalist....
10
2819
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
4
8750
by: bwalke | last post by:
I am developing a web form which is going to be used for manufacturing input. The form uses a DataList which list a batch of parts that may range anywhere from 1-9 parts. The DataList contains 6 ...
3
10278
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
3
2794
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.