I'm building a simple ASP.NET application that consists of four pages: Sign Up, Log In, Customer Page, Admin Page.
Upon logging in to the system there is a code about 30 lines long that sets some session parameters and does other important stuff.
Note: I can't run this code in the Log In page
So, What I'm ending up with is this bulk of code duplicated at Customer Page and Admin Page.
One Solution I was thinking about is creating a fifth page called LoggingGateWay. After successful logging in the LogIn page, users will be redirected to this page. It will run the bulk of code, and then redirect the users to one of the secured pages. The question is whether loading another page and having more transportation in this case is better than the duplication of code or not?
Thanks ahead for the answers! :)
问问题
29 次