I have an ASP.NET Web Forms application.
In this application I have a Login.aspx page with code behind. Now I would like to create LoginLight.aspx lightweight version of Login.aspx page.
The light version should have less HTML content and should use the key functions of Login.aspx.vb code behind. These functions have a lot of code.
Therefore, in order not to have a lot of duplicate code, I would like to move the common functions to a common file. I was thinking about placing those functions in a class library in the App_Code folder but I read on the web that is not a good solution.
I also read that to have the same code behind for two different pages because it is not a good practice. How would I tackle this issue?
Create a base page that has all the functionality that you want shared.
Login.aspx and LoginLight.aspx will both inherit that base page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With