473,387 Members | 1,435 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,387 software developers and data experts.

Using AddHandler in a DataList ItemDataBound event

I am trying to use the AddHandler method inside a DataList_ItemDataBound control. Here is the function

Private Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBoun
Response.Write("<br>Item bound"
AddHandler CType(e.Item.FindControl("txtNumber"), TextBox).TextChanged, AddressOf TextChange
End Su

And here is the TextChanged functions

Private Sub TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs
Response.Write("<br>Test has changed in datalist"
End Su

The data is being bound fine, but the TextChanged function is not being fired. Is there another step I need to perform? The purpose of this code is to eventually update a database, but only for the rows that have been modified. (I could just loop through them all, but I would like to optimize the function as much as possible.) I have a Submit button that causes the PostBack. Oh, and this is an ASP.NET application

Thank you
Scott
Nov 22 '05 #1
0 1671

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

Similar topics

0
by: Scott | last post by:
I am trying to use the AddHandler method inside a DataList_ItemDataBound control. Here is the function Private Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As...
1
by: Scott Schluer | last post by:
Hello, I've got myself a small problem and I'm hoping someone can help. I have a DataList called dlProducts (displays products from a database). Within the <ItemTemplate> container of the...
4
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
1
by: Mikkel Olsen | last post by:
Hi. I have a problem regarding to the DataGrid_ItemDataBound event. I cant run this event when my datagrid is inside a DataList. The ItemDataBound for DataList1 is working well, but it never...
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
8
by: Nevyn Twyll | last post by:
I have a multi-level datalist setup: DataList1 DataList2 MyGrid I have columns explicitly defined for the grid in the html. Sometimes, On the initial Load() of the Page, I want to add extra...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
2
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: ...
0
by: fig000 | last post by:
Hi, I have a datalist with bound data from a database. If I wanted to access one of the fields I would normally use the itemdatabound event to access that field on each row. However in this...
2
by: Nathan Sokalski | last post by:
I have a DataList control that I use the ItemDataBound event for. One of the properties of the DataList that I use in this event is Me.datMain.Items.Count (datMain is the id of my DataList) in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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
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
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...

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.