473,399 Members | 3,302 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,399 software developers and data experts.

Problem with missing button clicks

I have a very strange problem, I am dynamically creating buttons and events,
when page loads the first click works fine, every click there after the
event only fires every other click.

I made a listbox, and showed when each method fires, and it shows First
Click: Page_load, Click Event, Next Click: Page_Load, Next Click:
Page_Load, Click Event.

Nov 18 '05 #1
4 1264
It might be related to when you create the button and its
event. Click event will be raised after load event. If at
that time, the button is not created yet, the event will
not be raised.
Can you post your related code?

Bin Song, MCP
-----Original Message-----
I have a very strange problem, I am dynamically creating buttons and events,when page loads the first click works fine, every click there after theevent only fires every other click.

I made a listbox, and showed when each method fires, and it shows FirstClick: Page_load, Click Event, Next Click: Page_Load, Next Click:Page_Load, Click Event.

.

Nov 18 '05 #2
If you want server side event handling on controls that
were created dynamically then you have to wire the events
everytime you postback.

Suresh.
-----Original Message-----
I have a very strange problem, I am dynamically creating buttons and events,when page loads the first click works fine, every click there after theevent only fires every other click.

I made a listbox, and showed when each method fires, and it shows FirstClick: Page_load, Click Event, Next Click: Page_Load, Next Click:Page_Load, Click Event.

.

Nov 18 '05 #3
I am repopulating the table web control on postback. So they in fact should
be there.
But i am clearing table and recreating, is that what causing my problem
because the old id is gone and it creates another one?

I really don't know how to save out the table without repopulating it from
scratch.

"Suresh" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
If you want server side event handling on controls that
were created dynamically then you have to wire the events
everytime you postback.

Suresh.
-----Original Message-----
I have a very strange problem, I am dynamically creating

buttons and events,
when page loads the first click works fine, every click

there after the
event only fires every other click.

I made a listbox, and showed when each method fires, and

it shows First
Click: Page_load, Click Event, Next Click: Page_Load,

Next Click:
Page_Load, Click Event.

.

Nov 18 '05 #4
Page_Load

Update Table
Update Table

Table.Rows.Clear
Array = Directory.GetDirectories(Session:MyCurrentDirector y);
Table.Rows.Add (dir name, blah blah, button: Enter Directory);

EnterDirectory Click Event

Session:MyCurrentDirectory = (button) sender.Attributes["dir"];

"Bin Song" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
It might be related to when you create the button and its
event. Click event will be raised after load event. If at
that time, the button is not created yet, the event will
not be raised.
Can you post your related code?

Bin Song, MCP
-----Original Message-----
I have a very strange problem, I am dynamically creating

buttons and events,
when page loads the first click works fine, every click

there after the
event only fires every other click.

I made a listbox, and showed when each method fires, and

it shows First
Click: Page_load, Click Event, Next Click: Page_Load,

Next Click:
Page_Load, Click Event.

.

Nov 18 '05 #5

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

Similar topics

2
by: mike | last post by:
ok here's the problem: I have a page that displays a form for user to select individual fields and to specify their own criteria which is used to query a database and then create an excel...
3
by: Itai | last post by:
I have an aspx file named index.aspx which contains two ‘form' sections, one that has the runat=server attribute (e.g From1) and one which is a regular HTML form (e.g SignInForm). I am trying...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
5
by: Alastair Anderson | last post by:
I have created a very simple form with which I would like to update a single value in a single row of a database as a proof of concept. The relevant parts of the form are a DBWebTextBox (which...
3
by: Ravi | last post by:
Hi, I have a simple .aspx page where user enters data (e.g Name address, etc). At the end, he/she clicks Save button which Posts to the same page and in the Save button's click event I am saving...
3
by: Tim::.. | last post by:
Can someone please tell my why I get the following problem when I type the following piece of code! How do I get around this??? The idea is that when a user clicks a button on a form it causes...
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
2
by: knkk | last post by:
Hi, I want to put an iframe (or a frame) in a page on my website, with the content in the iframe coming from another website. But I want the entire page to reload when (1) anyone clicks on any...
14
by: Adam Sandler | last post by:
I have a class with a method which returns a panel. The panel was not created with the visual editor, I coded it by hand -- because some of the content on the panel can be dynamic and thus I chose...
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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.