Search code examples
.netapp-code

The best place for the hepler methods is MasterPage or App_Code?


Is it a good practice to place helper methods within the MasterPage?

Should I be worried that when I introduce new classes in App_Code folder it can result more objects to be created in the memory and build and application start times will be increased as well?

thanks!


Solution

  • If your helper function is specific to the type of page that your MasterPage templates, then go ahead and put in in there. Otherwise, add it to the App_Code.

    Don't worry about the memory required to put a function or a couple classes in the App_Code. It's not significant.