ericberman / MyFlightbookWeb

The website and service for MyFlightbook
49 stars 18 forks source link

Explore doing MVC side-by-side with webforms for eventual (long-term) migration to MVC and/or net.core? #888

Closed ericberman closed 2 years ago

ericberman commented 2 years ago

https://stackoverflow.com/questions/1685190/can-webforms-and-mvc-live-in-a-single-project

ericberman commented 2 years ago

Or Blazer. See doc at https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-6.0&tabs=visual-studio

ericberman commented 2 years ago

Can this work in a hybrid model? Need to think about:

ericberman commented 2 years ago

OK, got things up and running with "hello world" in a new branch. No functionality. But there are a few pre-requisite steps probably to follow:

Then can follow the instructions here: https://www.davepaquette.com/archive/2013/12/30/so-you-inherited-an-asp-net-web-forms-application.aspx. This gets hello world going. Add Area might not be visible, but you can do Add->New Scaffolded Item->MVC 5 Area. Note that Visual Studio needs to have both ASP.NET and web development->.NET Framework project and item templates AND ASP.NET and web development->.NET Framework 4.6.2-4.7.1 development tools installed.

ericberman commented 2 years ago

More useful: can use User.Identity.IsAuthenticated/User.Identity.Name and both seem to work correctly w.r.t. authentication. Yay! Session also seems to be present, but not sure if Session_Start/Session_End are called.

ericberman commented 2 years ago

Should probably upgrade to 4.7 on a separate work item.

ericberman commented 2 years ago

Cookie for privacy still not being found.

Also need to verify that [Authenticate] is all that is needed to require authentication for a page.

ericberman commented 2 years ago

AllMakes is now in production using MVC.

ericberman commented 2 years ago

So next thing to try: can we remove allmakes, privacy, terms, and a few other files and use routing to get them to the new location?

ericberman commented 2 years ago

Going to close this out now. Over time, I think there's more opportunity to move to jquery, react, or other things, but part of the site is now running MVC without any obvious problems.