473,412 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

How to get value from a textbox in DataList

Hello:

I've never used the DataList before, and I have a problem now:

In the ItemTemplate I put the LinkButton and a TextBox (not databound, I
want the user to be able to type in it). Then I try to retrieve the value of
the textbox by pressing the Linkbutton, like this, pretty much like I do it
in Datagrid:

Private Sub MyList_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataListCommandEventArgs ) Handles
MyList.ItemCommand
Try

Dim txt As TextBox
txt = CType(e.Item.FindControl("txtDomain"), TextBox)
Dim sDomain As String = txt.Text
Catch ex As Exception
Response.Write(ex.Message)
Finally
End Try
End Sub

If I type something in this textbox and press the button, the value is
always an emty string. Perhaps I just don't understand how the Datalist
works. What am I doing wrong?

I would appreciate your help.

Thank you,
--
Peter Afonin
Nov 18 '05 #1
0 1525

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

Similar topics

1
by: etantonio | last post by:
Good Morning, I still havent solved my problem with a textbox inside an editItemTemplate of a datalist, in fact now it is filled with the word "CIAOOOOOO" , if a runtime in the form I put a...
2
by: CDWaddell | last post by:
I have the following cod private void btnUpdate_Click(object sender, System.EventArgs e TextBox tbMembers = new TextBox() tbMembers = (TextBox) dlClubs.FindControl("tbMembers") string...
0
by: Peter Afonin | last post by:
Hello: I've never used the DataList before, and I have a problem now: In the ItemTemplate I put the LinkButton and a TextBox (not databound, I want the user to be able to type in it). Then I...
0
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....
2
by: Antonio D'Ottavio | last post by:
Good Morning, I've a problem with a textfiled inside a datalist, in particular it's value it is not updated with the changes, I mean sNomeCampo has still the value coming from the dB and not that...
2
by: VB Programmer | last post by:
I have a datalist for a shopping cart summary. Each data "row" has a text box where they can enter a quantity. How do I loop thru the entire datalist to figure out the total shopping cart price?
3
by: VB Programmer | last post by:
In my ASPX page how do I get the .text value of a textbox that is in the ItemTemplate of a datalist (using HTML)? The textbox contains the quantity for a shopping cart item. The textbox is...
9
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm trying to use the onblur client-side event to get the value of TextBox1 but can't seem to nail down the syntax. can someone please help? thanks, rodchar
1
by: BisMan | last post by:
I have a datalist called datalist2 I want to get the text from a textbox called textbox1 which is in the ItemTemplate of the datalist. In the past I have gotten information out of the create...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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,...
0
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...

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.