views:

227

answers:

1

If I use this code

vbc /t:library /r:System.dll,System.Data.dll,System.Web.dll,Cooperator.Framework.Web.dll, DateRangePicker.dll,DateRange.dll,conexiones.dll, abmbancos.aspx.vb

I can compile the codebehind file of an asp.net webform page into a dll file, as long as the codebehind file is declared with a regular class instead of a partial class and all the webcontrols are declared explicity

But we use partial classes for development so we dont have to explicity declare the webcontrols in the codebehind file. Now we need to compile the codebehind files into ddls and If I use the code posted in the begining to compile the same codebehind file, but declared as a partial class of the abmbancos.aspx file, and all the webcontrols arent declared explicity in the codebehind, I get all the errors that the webcontrols arent declared in the codebehind file.

How do I have to do for compiling the partial classes codebehind files or the codebehind file plus the interface aspx file into dlls?

+1  A: 

For classic ASP.NET Websites, the designer partial class is not saved on disk - it's generated at runtime only. You can combine the output of aspnet_compiler into a single DLL using aspnet_merge, but this will be for the website as a whole and not a particular *.aspx.

For the more recent Web Application project template, *.designer.cs will be saved as a separate file on disk, allowing the scenario you've described.

Nariman
Thank you for your answer, but arent those files for winforms applications only, because I cant find it. Where should it be in a website - webforms project?
GDalma
They're available under the Web Application project type only - see this link for more info: http://webproject.scottgu.com/CSharp/UnderstandingCodeBehind/UnderstandingCodeBehind.aspx
Nariman