Event Not Firing

J

jeff_mishima

Hello,

I've got an issue with a dynamically assigned event not actually being
assigned correctly to a linkbutton- or at least that appears to be the
issue.

The linkbutton doesn't work on 1st click, but does on 2nd click.

I've tried assigning the event as early in the page cycle as possible
(in OnInit() for example), calling the event-assigning function more
than once- all to no avail.

I've also stepped through the event-assigning function and it does
appear to be executing the event assignment for the linkbutton-
however, the first click on the lb does not do anything.

However, the event *does* fire on the 2nd click (after doing a
post-back).

Any ideas or suggestions are much appreciated.

TIA!

Jeff
 
G

Guest

Try throwing the event into the page_load (making sure NOT to put it into an
IsPostBack() check... see if that makes any difference.
Otherwise, you will probably have to show the pertinate code.
 
T

Trevor Benedict R

The easiest way to debug this would be to disable Smartnavigation (if you
have it enabled) and then browse to the page and do a ViewSource. The
Linkbutton should have the proper JavaScript code to raise the Event during
Postback. You can check the code the first time (you had mentioned that it
did not work) and then the code the second time (just before it actually
worked). The difference in this code will shed some light as to how ASP.NET
is working behind the scene and if you could post that then someone could
take it from there.

HTH

Regards,

Trevor Benedict R
MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top