0

I'm trying to edit a website that's already on IIS, and I don't understand why an event doesn't seem to be compiled when I build the solution. I created the event through the design view in visual studio, but I get the exception that there is no definition for the event declared. The dll file is being updated, as I can see by the modified time it lists, but why is the new codebehind being compiled as well? How can I fix this, because declaring the exact same code in a script section works?

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by jon4321
0

You have most likely created a event in your page code behind but failed to link it to your code behind. It is pretty easy to do in the designer.
For example you might have added a button so it will have

onclick="Button1_Click"

as part of its markup but no matching

public void Button1_Click() {}

method described in your code behind. Either implement the method or remove the call from your page HTML.

I hope that helps,

0

I actually double checked that it was in the codebehind. It matches up exactly, and when I copied the site to my local drive it compiled correctly.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.