473,378 Members | 1,609 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,378 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 1176

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"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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.