[Mono-dev] .aspx and .aspx.cs (spliting "codebehind") [SOLVED]

Gaurav Vaish (Mono) gvaish.mono at gmail.com
Fri Sep 23 09:46:01 EDT 2005

Hi Florian,

> Thx for the quick and very good advice.
> I tried it exactly the same way as you described (just the asp:form as
> form) and it actually worked (not just xsp but also mod_mono).

    Well.. form is an HtmlControl and not a WebControl.
    The "asp" prefix is, by default, registered to the namespace 
"System.Web.UI.WebControls". As such, it is supposed to work without "asp:" 
and not with it.

> I also found the reason for the problem I had:
> My .dll was called .aspx.dll. I just didn't think about that.

    That would not matter. All the DLLs in the bin folder are added for 
reference when the pages are compiled and executed. Changing the DLLs name 
would not matter. Just keep in mind that you do not have two DLLs that have 
definition of the classes with same name.

> If the source file is called something like WebForm1.aspx.cs there also
> needs to be Codebehind="WebForm1.aspx.cs" to be added and the dll still
> has to be called WebForm1.dll.

    As above... the DLL name can be absolutely anything. The craziest name 
that you can ever think of... and it will work all fine.

    In a little more detail -- consider if you have 1000 aspx pages in your 
project. You will not have 100 assemblies in the bin folder but probably 
just one assembly comprising of all the code-behind classes.

Happy Hacking,
Gaurav Vaish

More information about the Mono-devel-list mailing list