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?

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


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,

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.