Strange button behaviour

B

ByB

Hello,

I created an ASPX page with some buttons on it, but one of them is
reacting in a strange way :
In design mode, if i double click on it, it takes me to the
corresponding OnClick method. But if I put a breakpoint on this method,
when i work in debug mode and clicking on this button, it never takes
me to the breakpoint (so it's hard to say what it does ...)

Other buttons on the same page react normally.
I deleted the button, and recreated it with same Id and name, but no
change !

I move the OnClick method to the end of my code (in the page), and
moved the eventhandler to the end of the InitializeComponent method,
but still no changes ...

I wonder if you have met such behaviour, and if you know a way to
correct it ...

Thank you for any hint !!!
 
S

Steve C. Orr [MVP, MCSD]

Look in the generated code section and make sure the event handler is wired
up correctly. It tends to get messed up there in C# sometimes.
If it's VB.NET, look at the end of the first line of the sub and make sure
the Handles statement is there.
 
B

ByB

Steve C. Orr [MVP, MCSD] a pensé très fort :
Look in the generated code section and make sure the event handler is wired
up correctly. It tends to get messed up there in C# sometimes.
If it's VB.NET, look at the end of the first line of the sub and make sure
the Handles statement is there.

I work in C#, and the event handler seems to be correctly wired up ...
I put a label on the page, and when I click on the button, it is
supposed to print a mesage in the label, but the message doesn't
appear.
In fact, it seems that the button validates the form, but does nothing
else (in particular, it does not execute the OnClick() procedure ...)

Is it possible that some mess in the html code where the button is
could prevent the functionning of the button ? (just an idea)

Thanks
 
B

ByB

ByB a couché sur son écran :
Steve C. Orr [MVP, MCSD] a pensé très fort :
Look in the generated code section and make sure the event handler is wired
up correctly. It tends to get messed up there in C# sometimes.
If it's VB.NET, look at the end of the first line of the sub and make sure
the Handles statement is there.

I work in C#, and the event handler seems to be correctly wired up ...
I put a label on the page, and when I click on the button, it is supposed to
print a mesage in the label, but the message doesn't appear.
In fact, it seems that the button validates the form, but does nothing else
(in particular, it does not execute the OnClick() procedure ...)

Is it possible that some mess in the html code where the button is could
prevent the functionning of the button ? (just an idea)

Thanks

I solved the problem.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top