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

Extending the System.EventArgs class / AddHandler inside DataList

I have created an ASP.NET application that has a series of TextBox and Label
controls inside a DataList. I need to determine what the Label Control is
(it will hold the primary key of the DB record to update) and the
TextBox.Text value. I have the following methods defined, though if there is
another way, I'll be more than happy to change the way my page works. I have
it this way because I only want the update function (which I had planned on
putting in the TextChanged method) to run for the rows that have changed. I
can go through all the rows an update them all whether they have been
changed or not, but I would like to make it as efficient as possible.

I had also considered using the OleDbDataAdapter.Update command, but I'm not
sure how to use that correctly in ASP.NET. If you can point me to some good
examples, maybe that is the way to go.
Public Sub TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Response.Write("<br>Test has changed in datalist: " & sender.ID _
& " and value = " & CType(sender, TextBox).Text)
End Sub
Private Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataListItemEventArgs) Handles
DataList1.ItemDataBound
Response.Write("<br>Item bound")
AddHandler CType(e.Item.FindControl("txtNumber"),
TextBox).TextChanged, AddressOf TextChanged
End Sub
Thank you for your time,
Scott
Nov 18 '05 #1
0 1179

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

Similar topics

1
by: Arjen | last post by:
Hello, Does somebody haves a solution for this? Thanks! Line 74: if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
0
by: Scott Hamlin | last post by:
I have created an ASP.NET application that has a series of TextBox and Label controls inside a DataList. I need to determine what the Label Control is (it will hold the primary key of the DB record...
3
by: Patrick.O.Ige | last post by:
I'm loading an Array below but getting the error "Object reference not set to an instance saying 'ItemNumber = CType(Args.Item.FindControl("ItemNumber"), TextBox).Text' is the error line. I DON'T...
10
by: One Handed Man [ OHM ] | last post by:
If this is duplicated, I'm sorry because I cant find the original post I made today Anyway . . Now its my turn to ask a question I want to develop an app which will run in the system tray....
2
by: Sean Carey | last post by:
I converted a C# Upload app to VB.NET and am down to one error and was hoping someone could help me with te error. I would greatly appreciate help from anyone. Here is the error: ...
0
by: Brian Henry | last post by:
I thought this was useful, its a extender i just wrote for the new .NET menu strip and status strip to extend the menu items to add a status message so when a mouse rolls over the item it displays...
6
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
9
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender,...
3
by: Arpan | last post by:
Consider the following code: <form runat="server"> <asp:DataList ID="dlUsers" OnCancelCommand="CancelList" OnDeleteCommand="DeleteList" OnEditCommand="EditList" OnItemCommand="ItemList"...
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?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.