I have aspx forms generated dynamically, for blogs and shopping. When a user completes the article or item to trade, he clicks Submit and
- his input is written in SQL databse
- it creates a new .aspx file getting the content from a text template and replacing some parts with the user input.
I followed guidelines and I created a common code file for all the pages, MyCodeBehind.aspx.cs, and a codefilebaseclass in the App_Code folder, MyBasePage.cs
I found this on MSDN about the base class:
CodeFileBaseClass Specifies the type name of a base class for a page and its associated code-behind class. This attribute is optional, but when it is used the CodeFile attribute must also be present. Use this attribute when you want to implement a shared scenario, where you define common fields (and optionally, associated events) in a base class to re ...

Go to the complete details ...