473,379 Members | 1,174 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,379 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 1521

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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.