Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating Classic ASP - Webforms or ASP.NET MVC? [closed]

I'm doing some maintenance on a classic ASP application for my client, and as I'm looking through the ASP, the following question comes to mind - would it be easier to convert a classic ASP app to ASP.NET MVC or ASP.NET WebForms?

In many ways, it appears that at least the HTML of ASP might be easier to convert to MVC than it would be to rip out the HTML chunks and turn them into ASP.NET controls, repeaters, datagrids, etc. Plus having to add in handling and logic for ViewState, etc. might be added work.

I don't think my client will be requesting any upgrade like this, so this is just theoretical.

Let's assume that this ASP code is written very well (which isn't always true of course) so really the question is, will a best-case-well-designed ASP site migrate better to MVC than WebForms?

(Note that I'm very new to ASP.NET MVC, so I might be missing something crucial here).

like image 500
Sam Schutte Avatar asked Feb 11 '09 22:02

Sam Schutte


People also ask

Which is better MVC or Web Forms?

Asp.Net Web Form has built-in data controls and best for rapid development with powerful data access. Asp.Net MVC is lightweight, provide full control over markup and support many features that allow fast & agile development. Hence it is best for developing an interactive web application with the latest web standards.

Is MVC faster than Web Forms?

If you want to have a faster development cycle than Web Forms might be the best option. If time, money, and energy to develop an application from the scratch is not a constraint then MVC could potentially be the better option.

Is Classic ASP still used?

It used scripting on the server to create content that would then be sent to a client's web browser, and as a result it enjoyed a tremendous amount of success. Classic ASP, however, is no longer being developed by Microsoft at all – it has long since been replaced by ASP.NET in 2002, a newer alternative.

How is ASP.NET different from classic ASP?

ASP or also popularly known as Classic ASP developed by Microsoft is first Server-side scripting engine which is used for dynamic generation of web pages. ASP.NET, on the other hand, is a server-side web framework, open-source, which is designed for the generation of dynamic web pages.


2 Answers

It depends a lot on how the classic asp app is structured.

The server tag mixed in with HTML is similar to asp.net mvc but MVC is not as messy (or not supposed to be). You might be able to move the classic asp presentation code to a MVC view easier than to a web form. Also classic asp apps were usually developed with the statelessness of the web in mind. There probably is not anything in your classic asp that matches postabacks or viewstate. Classic ASP also uses normal html elements as opposed to asp.net webform controls. In these respects it matches MVC a lot closer than webforms.

If you do not know asp.net webforms or asp.net mvc I would say MVC is the way to go.

If you know webforms very well and don't know much about MVC I would say webforms is the way to go.

But, if your client for some reason does want a redevelopment of the site I would say go with MVC. It's always nice to have a client pay for part of your experience development as long as you can deliver.

On another note I'm always taken aback when I come across a client who wants me to do work on their classic asp site. In every single case the site is a mess. The worse part is that they are usually filled with huge security holes.

like image 198
dtc Avatar answered Sep 22 '22 06:09

dtc


I think in a lot of cases it could be easier to convert to MVC than Webforms. Most classic ASP apps demonstrate very little separation of concerns so the biggest task is probably exactly that, seperating out the logic into data access, business logic, business entities and UI components. In doing that it could well be easier to convert the inline ASP code to a view, the business logic into controllers and the business entities into the model.

like image 25
Adam Ralph Avatar answered Sep 20 '22 06:09

Adam Ralph