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

Event firing twice

I have loop that builds table rows, it also attaches events, this works fine
on all but the last row, where the event fires twice

I have autowireup set to false

any ideas?

For i = 0 To UBound(oCountries.getCountries)

Dim tr As TableRow = New TableRow

Dim td As TableCell = New TableCell

btCountry = New Button

AddHandler btCountry.Click, AddressOf CountryButtClick

btCountry.OnClientClick = "waitForIt()"

btCountry.Attributes.Add("class", "dButtons")

btCountry.CommandArgument = oCountries.getCountries(i).id

btCountry.BackColor = Drawing.Color.Transparent

btCountry.BorderStyle = BorderStyle.None

btCountry.Text = oCountries.getCountries(i).Name

td.Controls.Add(btCountry)

tr.Cells.Add(td)

countryTable.Rows.Add(tr)

Next
Dec 29 '06 #1
2 1119
"Slim" <me@here.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
For i = 0 To UBound(oCountries.getCountries)
For i = 0 To UBound(oCountries.getCountries) - 1

I'm actually quite surprised your code doesn't generate an "index out of
bounds" error...
Dec 29 '06 #2

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:uc**************@TK2MSFTNGP04.phx.gbl...
"Slim" <me@here.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>For i = 0 To UBound(oCountries.getCountries)

For i = 0 To UBound(oCountries.getCountries) - 1

I'm actually quite surprised your code doesn't generate an "index out of
bounds" error...
If I put a -1 I get one value short, its when you use the count property you
need to use -1, I always get them mixed up myself.

But I found my problem, I was attaching a event plus I had the "handles
btCountry.Click" on the event also.


Dec 29 '06 #3

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

Similar topics

3
by: Peter Row | last post by:
Hi, I have created a user control consisting of a textbox and a separate vertical scroll bar. The textbox is filled with data. However there could be lots of data so I only fill the textbox...
4
by: Larry Morris | last post by:
The following code, pasted into a web form with a link button on it, will cause the page_unload event to fire twice. If I remove the response.redirect, the problem goes away :). I've got a work...
4
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques...
4
by: ShaneFowlkes | last post by:
I have a odd thing happening. I have a sub that is called upon a button click and it seems to be firing TWICE. I have no idea how this is happening but I suspect is has something to do with...
2
by: ann | last post by:
I have a datagrid control I am using - the edit & update events are firing twice. I searched on google and see others have had same issue not just with datagrid but with other controls, but no...
14
by: TS | last post by:
I have this custom data list control and i override the onItemDatabound event. After upgrading to vs 2005, this event is not always getting called, though it does at other times. No changes were...
0
by: Daniel | last post by:
I've created a custom control including some Literal ( constructed with html markup) and an ImageButton firing event ( add a vote ). public event VoteCommandEventHandler VoteCommand; protected...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
18
by: joaotsetsemoita | last post by:
Hello everyone, I'm having troubles assigning an onclick event to a cell. Im trying something like cursorPoint.cells.style.cursor = "hand"; cursorPoint.cells.width = "20";...
3
by: =?Utf-8?B?QmFycnkgR2lsYmVydA==?= | last post by:
I have a class that raises events that downstream objects subscribe to. In one case, after destroying the object, the event seems to still get handled in a subscriber object. So I instantiate an...
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
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...
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...

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.