0

I have seen questions similar to mine, but there are some unusual specifics to mine not covered. I have a SQL SERVER driven ASP.NET web app (website). I am using the older webforms model, not MVC. I understand that MVC is usually a better overall model from what I know of it so far, but I'm not sure in my situation so I would like some opinions from people that know both MVC and webforms.

The site only has two database driven pages that logged in users can view for the entire site. Call them "viewer pages". The two pages are not even linked on purpose, so there is no navigation on this site.

The rest of the pages are what I would call "worker pages", and they are aspx pages with cs code behind. Each one is designed to handle a specific task it will get from ajax calls from one of the two viewer pages. They are the pages that get the database information to complete the ajax request with the needed data. They "could" be xml or json files or at least output those formats, but I chose the AHAH method because I know the exact html that the requesting page needs. So ajax requests come back as html snippets (divs) with no wrapping body or html tags, not xml or json. Therefore client side parsing is not required except some occasional jquery. I have about 30 of these.

I know MVC has some really big advantages for any normal site, but in my case, should I even bother? I don't see where it would give me an advantage except for the url structure feature that has no file extension, which I love about it. But if one looks at the site as a two page website, with no navigation or even links, and 30 pages that spit out xml, I can't see what MVC would do for me.

Thank for your opinions and advice. I would be happy to edit the question if I wasn't clear enough.

6
  • If you have an existing app in web forms, that meets your requirements; why change it?
    – TZHX
    Sep 17, 2016 at 17:52
  • I don't really have time for a full blown answer, but how often changes need to be made and hard hard those changes are to make have huge impacts on the answer to this question. If you don't need to modify it often, or find changes are easy & safe to make, then there may not be a benefit to moving to MVC. However, if you expect a lot of active dev on it, you could see real benefit from separating view from logic with MVC, but even then, MVP can be used with WebForms.
    – RubberDuck
    Sep 17, 2016 at 17:57
  • Well only two pages actually have an html and body tag (and other html). The rest just spit out div tags with db info inserted to answer ajax call. So the main things that are modified is the C# db queries and the javascript, and I can't see how MVC would help. Great when you have navigation, reuse, etc.... but I don't have much of that at all
    – user192632
    Sep 17, 2016 at 20:21
  • just to clarify, there really isn't much in terms of views, it's mostly just data being sent to one of two pages via javascript (which could be MVC views, but for only two pages?)
    – user192632
    Sep 17, 2016 at 20:26
  • @user192632 <div>s aren't data. They're sub-views. I recommend building a simple MVC app so you can get an idea of the separation of concerns that I'm talking about. Then you'll be in a better place to decide if you'd get benefit from a new architecture.
    – RubberDuck
    Sep 18, 2016 at 15:09

1 Answer 1

1

I understand that MVC is usually a better overall model from what I know of it so far [...]

I know MVC has some really big advantages for any normal site [...]

It seems like you've read somewhere that ASP.NET MVC is the future, and ASP.NET should die. While, indeed, some blog authors claim that, this is only their personal opinion.

This is not even the official position of Microsoft. ASP.NET was maintained until 2015, and ASP.NET 6, also called ASP.NET Core—a mix between ASP.NET, ASP.NET MVC and Web API, is on its way. There was never a mention from Microsoft that ASP.NET is a technology of the past.

Like any other technological choice, the one between ASP.NET and it's MVC variant should be done based on your specific requirements and preferences.

If you like Razor, you'll better go with ASP.NET MVC (although, this is not mandatory).

If you like MVC pattern (and its .NET variant, since other frameworks don't necessarily use MVC in the same way), you'll better go with ASP.NET MVC.

If you have a working web app written in ASP.NET, there is no reason to rewirte it in ASP.NET MVC.

If you have a team of developers who are skillful in ASP.NET and never worked professionally with ASP.NET MVC, go with ASP.NET, unless this is an experimental project and your team wants to try a new technology.

In all cases, it's up to you to make the choice. If there are no strong elements towards one or another technology, create a simple app in both, and compare your experience. Take in account the familiarity bias, that is the fact that the unfamiliar technology will appear as a poor alternative because (1) you don't know it much and can't be particularly productive, and (2) you try to apply the patterns from the familiar technology to the unfamiliar one, and this rarely ends well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.