views:

132

answers:

2

I assume I am not the first one having this problem and I am normally pretty good at googling for stuff but in this case I didn't succeed in finding a solution, so I'll post it here.

I have some experience in VB.NET and WinForms, now I am working on an ASP.NET project and I decided to do it in C#, so I can learn more technologies / languages.

I have been creating even handlers for controls by clicking the "Events" lightning bolt on the Properties windows and then double-clicking on the event name. That automatically creates an event procedure, selects it for the handler and opens the code behind with the procedure declaration already there. It has been working fine until now. I just added a FormView object and I am trying to create a handler for the ItemCommand event. As usual, I am double-clicking on "ItemCommand" under Events and it populates it with "fvMembers_ItemCommand" but it does not jump to the code behind and it does not create the actual function. I just tried doing the same thing in a different project that was created by somebody else and it looks like it's working fine there.

Any suggestions?

Thanks!

+1  A: 

The best recommendation for this is the following. Clear out the definition of the event, by right clicking and selecting "remove". Save any progress that you have, exit visual studio, and then go back to the project.

Be sure that you don't have any build errors then try it again. I've found that VS just needs a re-start every so often.

Mitchel Sellers
Yep. VS2005 and 2008 do that on occasion. I've had *many* weirdnesses like this go away on reboot of VS. Mitchel is right.
Rap
A: 

Now, don't I feel stupid :) I didn't even have to close VS. I closed and re-opened the solution and it appears to be working now. I just had a situation yesterday where an ObjectDataSource wasn't reflecting the latest structure, "Refresh Schema" wasn't helping either. Rebulding the solution didn't help either but it helped restarting VS. I don't think I ever had to re-start VS while working on WinForms projects but it looks like working on ASP.NET requires frequent VS restarts.

Thank you for your help!

Alex