Click here to Skip to main content
14,732,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a legacy web forms application, now we are planing to migrate entire application into mvc step by step.

Now I want to add new functionality using MVC with authentication to existing web forms application, my first step is adding authorization filter and I want to apply this authentication to only MVC controllers not for web forms.

What I have tried:

I just opened web forms project, I am not sure weather to add new MVC project to the existing application or I need to add AREA folder and add MVC controller directly to the web forms project,

Kindly help me which scenario will help me to migrate entire application to MVC in different phases.
Updated 27-Nov-19 1:41am

1 solution

0) Start a new MVC5 project, and make sure it includes user authentication.

1) Update all of the nuget packages in your new project.

1) That's all you have to do to include user authentication/authorization in a MVC app, unless you want to modify the views that the user is presented with to login/register, etc.

2) Re-implement the legacy app's pages in the new MVC app's views.
Divyay208 27-Nov-19 9:38am
Thanks for the answer, I have one more doubt
1) I am going to implement new pages with MVC application
2) Until the completion of all phases of migration I want to use both MVC and Legacy application together
3) Is it possible?
#realJSOP 27-Nov-19 9:49am
I wouldn't to it that way. Leave the legacy app alone, and re-implement it as a mvc app. When you're happy with the mvc app, replace the legacy app with the mvc app on the web server.
Divyay208 27-Nov-19 11:03am
But this case I have new requirement which I need to add it to existing application so instead of implementing it in web-forms I thought of implementing it in MVC that way I can save time, Is there any other way we can implement?
#realJSOP 27-Nov-19 11:09am
My point is to keep them separate. Update your legacy app, and move the new feature to the MVC app. Don't cross the streams - you'll end up frustrated with a broken app that you can't fix. ASP.Net Web Forms is SIGNIFICANTLY different from MVC. Trust me, I've been in exactly the same position as you are right now.
Divyay208 27-Nov-19 11:33am
Thank you for the suggestion.. I will Implement the way you suggested

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900