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

Button Click events going into Bermuda Triangle, news at 10

here is the problem, I have a table with dynamic buttons and events.
On buton click of said row, it would clear the rows in the table, and
repopulate it.

This works fine the first time you run the app on the first click.

Every other attempt to click one of these buttons fires a page load only,
upon the 2nd click a button click event is fired. This was verified by
adding a list box to the page, in Page_Load and Button_Click event adding
code to add an item to the listbox denoting which method was called.

When clicking the buttons, I see Page_Load, clicking a second time I see
Page_Load, Button_Click as I would expect (and how it works the very first
time the page is clicked).
Nov 18 '05 #1
2 1392
If your buttons are dynamically created then their events
(assigning the event handler) and buttons have to be
recreated on every postback.

Suresh.

-----Original Message-----
here is the problem, I have a table with dynamic buttons and events.On buton click of said row, it would clear the rows in the table, andrepopulate it.

This works fine the first time you run the app on the first click.
Every other attempt to click one of these buttons fires a page load only,upon the 2nd click a button click event is fired. This was verified byadding a list box to the page, in Page_Load and Button_Click event addingcode to add an item to the listbox denoting which method was called.
When clicking the buttons, I see Page_Load, clicking a second time I seePage_Load, Button_Click as I would expect (and how it works the very firsttime the page is clicked).
.

Nov 18 '05 #2
Hello Michael,

Michael Johnson Jr. wrote:
here is the problem, I have a table with dynamic buttons and events.
On buton click of said row, it would clear the rows in the table, and
repopulate it.

This works fine the first time you run the app on the first click.

Every other attempt to click one of these buttons fires a page load only,
upon the 2nd click a button click event is fired. This was verified by
adding a list box to the page, in Page_Load and Button_Click event adding
code to add an item to the listbox denoting which method was called.

When clicking the buttons, I see Page_Load, clicking a second time I see
Page_Load, Button_Click as I would expect (and how it works the very first
time the page is clicked).


Besides what Suresh mentioned, you also have to be sure that the identifiers
of the dynamically created controls are the same when they're first created
and when they're re-created from Page_Load to restore state.

In your case I'm almost sure you have to assign the identifiers yourself,
because with the automatic identifier assignment, I think the identifiers
won't be the same in the two mentioned cases.

If you're already assigning identifiers yourself, then it's good to
check by debugging whether the identifiers are constant.

Best regards,

Eric
Nov 18 '05 #3

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

Similar topics

5
by: Justnew | last post by:
I have a button in my webform.aspx And I have a htm document or page. What I want is that when I click on the button I want to display the htm page. In other words it is just a back button ...
7
by: Amadelle | last post by:
Hi all and thanks in advance, I am stuck! I can't figure out how to identify which button was clicked on my ASP.NET page in the PostBack event? So what I am trying to do is to is to have an if...
4
by: Ryan Ternier | last post by:
I have a button event: Public Sub SwitchItem(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim btnTest As New Button Dim astrTest As String() btnTest = CType(sender, Button)...
4
by: Mick Doherty | last post by:
Steps to reproduce: Inherit from button. Add button to project's form. Run project. Make button Default. Press and Hold SpaceBar (so button is pressed) Move Mouse. Release SpaceBar.
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
4
by: Bob | last post by:
Hi, I'm working with VWD and i defined programmatically a button (in code-behind) with an ID. So I expect to see beside "Page Events" and "Form1" my button "b1" in order to use the Click event....
5
by: Smokey Grindel | last post by:
I have a button on the form which has causes validation set to true... when I click on it not one of my validating events fires on the form... every single control with it just skips over it and...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.