|
-
Dec 9th, 2002, 10:17 AM
#1
Thread Starter
Lively Member
Why won't a button's click event fire in ASP.NET?
Hi, there.
I have a button on an ASP.NET Webpage and have added code to its click event. However, when I run the application and click on the button, the click event code is never run.
I placed a breakpoint on within the the button's click event so that I can tell if that code is run. However, I noticed that when I fire the app up in debug mode, a question mark appears over the breakpoint with the following message:
"The breakpoint will not currently be hit. No symbols have been loaded for this document.".
What does that mean? Why won't the event fire? In my other Webpages, there has never been a problem like this.
-
Dec 9th, 2002, 10:20 AM
#2
Can you show code please?
-
Dec 9th, 2002, 10:41 AM
#3
Thread Starter
Lively Member
RESOLVED
I have come up with a resolution to this problem.
The way that I created the click event was by double-clicking the button on the form view in the VS.NET IDE. This switched to the codebehind view and added the click event procedure to the code. I then added my code within this event. In VB6, I and even with my other ASP.NET applications, I have never had any problem with this running.
However, I noticed in the code view that, when I select the button in the "class name" dropdown list at the top of the screen, its "click" event is not bolded in the "method name" dropdown list as it should be if the application recognizes the method.
If, instead of creating the event code by double-clicking on the button in the form view, I select the button in the "class name" dropdown list and then select the "click" method in the "method name" dropdown list, VS.NET creates a new click event procedure for the button. When I put my code in there, it works.
I have no idea why it works this way because the code that VS.NET generates to define the click event procedure looks exactly the same with either method. Maybe it's a bug?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|