Be careful saying this, the last time I brought this up everyone lost their minds.
But, yes, this was the promise of Asp.Net's Ajax, and while some of the issues with that were due to how it worked, many of the issues were the result of having no separation between client and server code, and when the client magic had an issue it was very difficult to resolve (except "Let's just wait for Microsoft to patch this!" or "Let's just alter the built in Asp.Net library ourselves").
I think WebAssembly is the future, I think mixing client and server code in one place is always going to get messy. I learned my lesson from Asp.net. At least with Razor you're only generating HTML, so moving it to another web framework would be fairly trivial if you needed to (including just going raw HTML with a template library like Handlebars.js).