Last post Dec 17, 2007 06:08 PM by wtroom
Dec 17, 2007 04:42 PM|jahabdank|LINK
In my website I have one Default.aspx page with one placeholder (which works like a masterpage, but is still a aspx), and a lot of user controls which serve as subpages. When I publish the webpage the ascx files still remain inside - and I thought that the
.net will translate them into c# code, and then dll ... How to make that happen? I do not want anyone to be able to change or even view the contents of the usercontrols after the page is published (that is one reason why i do not have the master page design)
... My ideal published website would look like Default.aspx with ONE placeholder, one DLL with all user controls compiled into it and one language file - nothing more. How to do something like that ?
I can of course create WebControls for each of the pages but it is soooo time consuming, to write everything in C# ... - I just want to compile the ascx's to a dll ...
Thanks a lot,
Dec 17, 2007 06:08 PM|wtroom|LINK
Well it seems as though you have a couple of options. You can publish your website in Visual Studio without checking the box that says "Allow this precompiled site to be updatable". This will compile the project and the final result would be your one default.aspx page,
all of your ascx controls with the format of having a dll and the ascx controls having a .compiled extension. This would eliminate people seeing the code behind or markup for the usercontrols. It would also eliminate people see the code behind for the default.aspx
page, but they could still see the markup on the page (which in your case sounds like just a placeholder). I like this method because it is easier to update the site if you need to make changes to the user control because you can just copy the new files
(which will have the same name after being compiled) over to the production site. Otherwise, if this does workout the only other option I know of is using the Web Deployment Project for Visual Studio 2005 which is located here:
This will get you started on how to build your project a few different ways. I know you can combine all of the pages and controls code behind into 1 dll, but I don't know if you can eliminate not seeing the markup with the user controls.