2

I have a rather complex and huge website which is currently an hybrid of webforms and mvc4 technologies. We want to migrate it into an Angular based site such that the UI is uniform. I need some guidelines for the best way to move forward. To start, I have the following questions.

  1. Can the hybrid site as it is ported to Angular or first we have to convert the webforms section to mvc 4 and then convert mvc 4 to Angular?
  2. Can the webforms be converted to Angular based at all?
  3. Will AngularJS work only with WebAPI, or with any backend data such as asp.net/wcf webservices will work also? Put in another way should the business layer has to be rewritten in MS WebAPI?

Thanks

    1 Answer 1

    2
    1. Can the hybrid site as it is ported to Angular or first we have to convert the webforms section to mvc 4 and then convert mvc 4 to Angular?

    You can have a hybrid solution of ASP.NET WebForms or ASP.NET MVC with AngularJS. You do NOT need to convert from WebForms to MVC in order for AngularJS to be used within your existing web application. You can add the AngularJS script (angular.js) to your master page and then put your custom JavaScript code (controllers, services, etc.) within your ASP.NET Scripts folder, or create structure within your Scripts folder for a cleaner separation of content. AngularJS is just JavaScript.

    1. Can the webforms be converted to Angular based at all?

    Using AngularJS is not a "conversion" process, it is not a replacement for ASP.NET technologies, necessarily. In other words, you can have AngularJS work in conjuction with ASP.NET or you can write an AngularJS application completely independent of ASP.NET. It is NOT an either-or proposition. AngularJS is just JavaScript.

    1. Will AngularJS work only with WebAPI, or with any backend data such as asp.net/wcf webservices will work also? Put in another way should the business layer has to be rewritten in MS WebAPI?

    No, AngularJS does NOT need ASP.NET Web API as the backend, it will work with a multitude of server-side technologies (Node.js, PHP, ASP.NET). Specifically for ASP.NET, you can use ASP.NET AJAX Page Methods, ASP.NET MVC Action methods, WCF, ASP.NET Web API, etc. AngularJS is just JavaScript.

    I hope you are getting the point that AngularJS is just JavaScript that can be plugged into existing and new architectures. Think of it like jQuery. jQuery is not a "conversion" process from ASP.NET WebForms to ASP.NET MVC, it is a complement to the technology, sometimes working well and sometimes not so much; really depends upon what you are trying to accomplish.

    3
    • Thanks for the very clear reply. I have one more question to clarify. Most of the MSDN articles suggest to use Angular in conjunction with MS REST WebAPI. Is there any advantage of using the WebPI in the backend?
      – Massey
      CommentedJul 29, 2015 at 3:54
    • ASP.NET Web API lends itself to creating REST-like endpoints very easily and AngularJS conforms fairly well to REST, especially using the Angular-Resource script ($resource). This is not to say that you must use $resource, as the $http service will allow you to make AJAX calls to ASP.NET Web API as well. I think Microsoft is making that recommendation on the common theme of REST between AngularJS and ASP.NET Web API.CommentedJul 29, 2015 at 4:05
    • How far is this project? I'm currently converting something into dll's because i already did this project ( on a large enterpise basis) and i want to check if it's usefull
      – NicoJuicy
      CommentedNov 10, 2015 at 15:14

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.