Javascript library or framework to use in Razor Pages

John Patrick S. Po 41 Reputation points
2022-03-04T09:16:05.93+00:00

Hi I'm not a big fan of SPAs I'm using razor pages most of the time and it has always been jquery, jquery ui and bootstrap. (Jquery is becoming obsolete or is it already?)

are there any new javascript library and/or frameworks out there that I can use (open source ones please =) )?

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 30,126 Reputation points
    2022-03-29T14:26:19.783+00:00

    Thank you for your reply. But I'm a solo developer been using asp.net mvc since version 3. separating the UI and backend will be a lot of work for me. Is it really necessary?

    Okay, so you do not want to change because it is too much work. That's fine. Stick with what you know.

    If I remain to use razor pages what javascript library or framework should I use?

    You're asking this question as if there is a magical unifying framework. Make a list of the required features and pick a JavaScript library that supports the requirements. As stated above, vanilla JavaScript works across all browsers these days. So plain old JavaScript is an option.

    Should I jumpship to backend: asp.net web api(.net 6), frontend: (typescript + react)? will that be a lot more to work on? Should I remain to use razor pages?

    It's up to you. I went with React a few years ago because it was easy to integrate React into an existing web application.

    Do a bit of experimentation to find what works for you.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Rijwan Ansari 766 Reputation points MVP
    2022-03-04T11:00:56.547+00:00

    Hi @John Patrick S. Po

    JavaScript is not going to obsolete anytime soon. It is not in danger or will not be replaced anytime soon. However, the usage of JavaScript has expanded over the time and will be expanding. We cannot imagine web without JS.

    Now, JQuery is still used widely in many platforms like WordPress. But, the use is slowing because of latest front-end frameworks.
    Coming back to your question, there are several front-end frameworks which are easy to use, simplified and getting popular like Angular, Vue.js, ReactJS and so on.
    You can use anyone of the front-end framework. However, the base is JavaScript.
    These days, Blazor is also getting popular.

    Example:

    ASP.NET with Angular.
    https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-angular?view=vs-2022

    ASP.NET with Vue
    https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-vue?view=vs-2022

    ASP.NET with React.
    https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-react?view=vs-2022

    ASP.NET with TypeScript
    https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-aspnet-with-typescript?view=vs-2022

    0 comments No comments

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-03-04T16:24:51.487+00:00

    you are at a difficult time. most of the javascript frameworks are dedicated to SPA development. This largely due to the tool chains supporting module and hot loading. npm module support is key for most frameworks, but the build tools are geared toward a single output bundle. the browsers are adding support for modules, but the build tools do not support this yet.

    you can build MPA (multi page app) with webpack or similar, but the docs are light, and none of the cli tools support this.

    jQuery is not dead, just not as important as browser compatibility is better, and jQuery is not required with other frameworks. jQuery is still popular with web designers who write plan html, and need to add effects. You may fall into this group.

    jQuery-UI has been dead for years, jQuery and bootstrap is a better choice.

    vue.js is probably the most MPA friendly framework and being template driven works well with razor pages

    note: I'm a react developer. so you are correct, I only use webapi and no razor pages. We have some MPA react apps, but are converting them to SPA for developer simplicity.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.