Although the assembly contains some pre-compiled methods, the .ascx
page is still "interpreted" (technically it's compiled, but IMO it's easier to think of it as interpreted) every time the page is requested (well, not every time, since it's often cached, but certainly the first time changes are made). Try it for yourself -- make a change to some of the markup in a .ascx
file and then request the page -- you'll see that your changes are reflected in the response (you may have to restart the site if it's cached).
So, following from this, you will need to deploy both of the files, as both are used by IIS to service a request.
On another note, you can sometimes run into strange problems when just deploying a single assembly (or maybe it's just me being paranoid because I thought this happened to me once) to a live site -- it's safer to deploy the entire site at once. Unrelated to the question itself, but I thought I'd note it.