aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

WebForms in Asp.NET Core

Open maddymi opened this issue 9 years ago • 55 comments

Immo Landwerth asked me to post this here:

Are there any plans to port WebForms to .NET Core? Many companies, especially Fortune 500 have huge amount of code in Webforms. I think Damian Edwards mentioned Webforms could be ported to .NET Core. So I wanted to ask if .NET team have any ETA on this?

maddymi avatar Mar 13 '17 00:03 maddymi

I would also like to see this. MVC also has a big learning curve for beginners. MVC can get very complicated for large apps. Here is a related link about big sites like facebook avoiding MVC: https://www.infoq.com/news/2014/05/facebook-mvc-flux

https://www.quora.com/Do-big-websites-like-Google-Facebook-or-Twitter-use-MVC/answer/Steve-Cook-49

BillJones50 avatar Mar 13 '17 02:03 BillJones50

No there is no plan to port webforms to ASP.NET Core.

davidfowl avatar Mar 13 '17 02:03 davidfowl

From my understanding, MVC (on .Net standard framework) sits on top of WebForms. If you disable viewstate in web.config, it removes a lot of unwanted data (if you dont want to save state on page load). Microsoft recently ported SQL Server to Linux OS by providing a shim and thus were able to use most of the original SQL server code (instead of complete rewrite).

Since Microsoft .NET team is currently working on .NET Core 2.0 release, they can provide a similar "shim" to allow code written in "WebForms" to run on ASP.NET Core 2.0. This could be possible since many things are now modular.Because of shims, the LOE may be lower.

john2014 avatar Mar 13 '17 06:03 john2014

Mvc does not sit on top of webforms...

davidfowl avatar Mar 13 '17 07:03 davidfowl

Sorry I mispoke. I mean MVC, Webforms and WebPages sits on top of .Net Framework.

john2014 avatar Mar 20 '17 00:03 john2014

Does Asp.Net Core have something equivalent to PHP, Pyhton, etc? Many people do not always have time/patience to deal with MVC.

Heck even Scott Hanselman mentioned few days ago in Community standup that he doesn't want to deal with models, view, controllers in his website blog. Here is a link: https://youtu.be/qlVE5iDjBIg?t=18m30s

It would be great to have something similar to WebForms or WebPages which is quick to start and finish. Lots of developers would be very happy with that.

The only other current alternative is to move to another programming languages/frameworks.

katie20 avatar Mar 21 '17 00:03 katie20

See https://github.com/aspnet/Mvc/issues/494

davidfowl avatar Mar 21 '17 05:03 davidfowl

I thought it is impossible to port webform platform in technical issue. I would suggest try mono-project if you want run webform as well as MVC5 in Linux.

LeoCheung777 avatar Jun 12 '17 08:06 LeoCheung777

Have you seen DotVVM?

It is not Web Forms on .NET Core, but:

  • many concepts in DotVVM are similar to ASP.NET Web Forms (postbacks, server controls, master pages, even the names of the controls and page lifecycle events)
  • it is easy to learn for ASP.NET Web Forms developers
  • no cryptic viewstate hidden field
  • the controls don't produce ugly HTML
  • the MVVM pattern is used
  • no need to know or write JavaScript - C#, HTML and CSS is enough to start coding
  • DotVVM supports both .NET Core and full .NET Framework
  • can be added to existing ASP.NET Web Forms or MVC applications on .NET Framework
  • DotVVM is open source
  • Visual Studio extension with IntelliSense and project templates

Disclaimer: I am one of the authors of DotVVM. This post is not meant to advertise the project, I just believe it responds to the question because the main motivation to build DotVVM was the fact that Web Forms are not ported to ASP.NET Core. We didn't want to just port Web Forms, we wanted to build a framework which is conceptually similar and which avoids the things Web Forms were criticized for (viewstate, testability and ugly HTML output).

tomasherceg avatar Aug 21 '17 09:08 tomasherceg

@davidfowl - Does this constitute the official EOL statement from MSFT for WebForms?

StingyJack avatar Jan 10 '18 13:01 StingyJack

Does Asp.Net Core have something equivalent to PHP, Pyhton, etc? Many people do not always have time/patience to deal with MVC.

@katie20: If you don't want MVC, use NancyFx for .NET Core. https://github.com/NancyFx/Nancy

Really just like Sinatra for Ruby. No annoying controllers & actions, and yet it uses routing. Not like WebForms, though - but that is a good thing.

ststeiger avatar Sep 28 '18 09:09 ststeiger

With .NET Framework now essentially deprecated, it is really not ok for Microsoft to not offer any upgrade path for the tons of WebForms code out there, especially given that WPF and WinForms are making the leap to Core.

The result of this is that you're going to bifurcate the .NET ecosystem like never before. The web is many times bigger than the last time you did this (classic ASP -> ASP.NET). You're going to end up having tons of websites sitting on WebForms and an ancient version of .NET for decades.

MgSam avatar Nov 16 '18 18:11 MgSam

@MgSam The .NET Framework is not deprecated and will continue to get support and updates. It will just evolve slower compared to .NET Core. As a result, WebForms is still fully supported and that will continue to be the case for quite a while. See the blog post for more details.

Having WebForms support on .NET Core for the purpose of offering an upgrade path doesn’t really make sense anyway since WebForms simply wouldn’t run in a fully compatible way on .NET Core. So you would have to migrate your application anyway. And and that point, you’re better of migrating off WebForms since that’s the actual ancient thing in the combination WebForms & .NET Framework.

poke avatar Nov 16 '18 23:11 poke

@poke Major platform features that are required for C# 8 are not being added to the .NET Framework and will never be added. Microsoft can call it whatever they like but in the rest of the world we call this being deprecated.

It is disingenuous of you to suggest otherwise. Silverlight and Flash also might technically still be getting updates in the form of security fixes but you'd be hard pressed to find anyone who says these platforms are not deprecated.

MgSam avatar Nov 17 '18 16:11 MgSam

@poke Having WebForms support on .NET Core for the purpose of offering an upgrade path doesn’t really make sense anyway since WebForms simply wouldn’t run in a fully compatible way on .NET Core. So you would have to migrate your application anyway. And and that point, you’re better of migrating off WebForms since that’s the actual ancient thing in the combination WebForms & .NET Framework.

Could you elaborate on this ? Not that I wish webforms back, but @MgSam is right when he says that full-framework's non-depreciation is disingenuous.

@MgSam You might want to have a look at Blazor, that might well be the future of Web-Forms/Silverlight/WPF. https://blazor.net/

Note: Google might not be able to index blazor-sites - so this would be bad for SEO for the time being. But if you offer WebApplications that are sold OnPremise or SaaS, that might not matter for you, and it might even be a good thing, security-wise.

Blazor looks like it is WebForms, Silverlight & Flash all-in-one.

ststeiger avatar Nov 17 '18 18:11 ststeiger

@ststeiger Just like ASP.NET MVC is not forward compatible to ASP.NET Core MVC, you shouldn't expect that a theoretical ASP.NET Core WebForms would be able to run your old code. It would be very likely that you need to adjust large parts of your application just to allow to run it on the new version.

So it does not really make sense to ask for a new WebForms just for the sake of having a compatible upgrade path.

And if you think about it, with WebForms on .NET Framework, it's not the framework that's the ancient technology but rather WebForms itself. Today, there's little to no reason to build new stuff in WebForms; there are approaches like MVC that are superior in every way.

So basically what I am trying to say here: If you currently have a WebForms app on .NET Framework, then the real reason to look for an upgrade path would be to get rid of WebForms. But having the slowly evolving framework there is not the problem.

@MgSam The big difference with Silverlight and Flash is that there is almost no platform left where they can run on. Browsers stopped supporting Silverlight, and the few browsers that do support Flash only do this as a specific exception.

The .NET Framework however will continue to have Windows as its platform and will also continue to ship with it. Maintaining compatibility is key here for Microsoft. That is the reason, the .NET Framework is now moving slower; it is not the other way around. They are prioritizing compatibility of existing applications over innovation. That is generally a good sign for anyone running older applications.

poke avatar Nov 17 '18 18:11 poke

Maintaining compatibility is key here for Microsoft. That is the reason, the .NET Framework is now moving slower; it is not the other way around. They are prioritizing compatibility of existing applications over innovation. That is generally a good sign for anyone running older applications.

A good sign would have been to just start updating netfx in place with the parts they have been adding as netcore. Unless its trival, rebuilding something from scratch is almost always the worst choice due to the amount of effort required vs fixing something existing. The only other reason to do it is because the existing thing cannot be salvaged or repaired, which is what the outward impression is for me.

Microsoft seems to be turning its back on everyone who has invested in netfx applications. I agree with @MgSam except that its not a bifurcation, its a shattering.

StingyJack avatar Nov 17 '18 18:11 StingyJack

.Net Core is useless to my company without Web Forms. We must have Web Forms in .Net Core to get our work done efficiently.

JosephRufft avatar Dec 06 '18 16:12 JosephRufft

@JosephRufft Feel free to stick with WebForms on .NET Framework then.

poke avatar Dec 06 '18 20:12 poke

@JosephRufft My team has a LARGE asp.net project, with several hundred aspx forms. We converted the entire project to razor (cshtml). We built some tooling to do it. It does feel very good to get to the other side.

samjones3 avatar Dec 06 '18 22:12 samjones3