Firing events?

G

Guest

I have a webform with an Image Button on it and an attached event handler
for a Click event.

I have the same on another page.

This click event for the first one doesn't work - you click on it and it
doesn't even attempt to postback.

The second one does.

The code between the two pages seems the same however when I view source on
the second one I get all of the web/ui/ javascript functionality but not on
the first.

Is there a switch or something I could be missing?

Many thanks

Jof
 
C

Cowboy \(Gregory A. Beamer\)

Check the HTML code and ensure both buttons are nested in the <form> tag. If
not, you will not get a postback for the button outside.

Second, make sure you have the handler set up. For some strange reason, esp
with Visual Studio .NET, the handlers are lost. I have only had this happen,
thus far, in Visual Basic .NET. The handler will be something like:

Protected Sub Button1_Click(sender As Object, e As EventArgs)

It needs to be like:

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click

For C#, the handler is like:

Button1.Click += new EventHandler(this.Button1_Click);

Once you link the handler set up, everything works fine.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
S

Sunil TG [MVP]

Just try removing the image button for which the event
does not work, and add it again. Don't waste time in these
matters buddy!

Sunil TG
 
G

Guest

Tried that already...but....

the solution is overlapping forms.

on my page I had a server control with its own form and they were
overlapping.

Solution solved! Thanks for the help though!
 
S

Softwaremaker

Hi,

could we take a look at your codes for the first button, both the UI and the
implementation part of it

--
Thank you very much

Warmest Regards,
Softwaremaker (WilliamT)
Software Architect
+++++++++++++++++++
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top