From Legacy Constraints to Modern Revival
In the past, Microsoft WebForms was a system that offered only limited and inefficient patterns. Structural weaknesses, heavy dependency on ViewState, poor performance, and lack of flexibility forced many developers and businesses to migrate their systems to MVC, Razor Pages, Blazor , and even Minimal API .
These migrations primarily occurred because Microsoft failed to present any clear roadmap for improving and modernizing classic WebForms.
However, in 2024 , the Elanat introduced WebForms Core —a completely new approach that not only distanced itself from the weaknesses of classic WebForms but also redefined its concept with modern web architecture.
Initially introduced as one of the core capabilities of the CodeBehind framework, this technology rapidly gained traction due to its standalone design and flexibility, becoming implementable and executable in various popular programming languages .
Today, Elanat has released WebForms Core as a standalone package on NuGet , enabling direct usage in .NET projects including MVC, Razor Pages, and Minimal API.
Package link:
https://www.nuget.org/packages/WFC
WebForms Core: Neither a "Return to WebForms" Nor a "Blazor Competitor"
What WebForms Core Is NOT:
❌ NOT a revival of classic WebForms – No ViewState, no page lifecycle complexities
❌ NOT a Blazor alternative – Different architecture, different use cases
❌ NOT another JavaScript framework – Server-first, JavaScript-light approach
❌ NOT tied to specific UI patterns – Works with MVC, Razor Pages, and Minimal API
What WebForms Core IS:
✅ A serious server-centric DOM platform in the .NET ecosystem
✅ A modern architectural alternative for server-driven DOM control
✅ A bridge between backend logic and frontend interactions
✅ A performance-optimized , modern approach to full-stack development
Architectural Innovation: How WebForms Core Works
The Core Principle
WebForms Core operates on a simple yet powerful principle: Server controls DOM, Client renders efficiently .
Server-side (.NET)
WebForms form = new WebForms();
form.SetValue("username", "JohnDoe");
form.SetBackgroundColor("<main>", "lightblue");
form.SetGetEvent("btnSubmit", "onclick", "/api/submit");
return form.Response();
Result
[web-forms]
svusername=JohnDoe
bc<main>=lightblue
EgbtnSubmit=onclick|/api/submit
The client-side WebFormsJS library (just 40KB after Minify + Gzip) interprets these commands and applies them to the DOM with surgical precision.
Key Technical Innovations
Lightweight Protocol : Uses a simple INI-Like protocol instead of heavy JSON/XML
Intelligent DOM Targeting : Advanced selectors for precise element manipulation
Built-in Real-time : SSE and WebSocket support out of the box
Automatic Optimization : Only changed data is transmitted
No JavaScript Fatigue : Minimal client-side code required (Close to zero)
Why .NET Developers Should Pay Attention
For Backend-Focused Teams
WebForms Core addresses a critical pain point: backend developers can now build interactive UIs without deep frontend expertise .
Traditional approach: Backend API + Frontend Framework
[ApiController]
public class UserController : ControllerBase
{
[HttpPost("update")]
public IActionResult UpdateUser(UserDto user)
{
// Backend only - frontend needs separate implementation
return Ok(new { success = true });
}
}
WebForms Core approach: Unified control
public class UserController : Controller
{
public IActionResult UpdateUser(UserDto user)
{
WebForms form = new WebForms();
form.SetValue("displayName", user.Name);
form.Message("User updated successfully", "success");
form.SetDisabled("btnSubmit", true);
return Content(form.Response(), "text/plain");
}
}
Performance Advantages
| Metric | Traditional SPA (React/Vue/Angular) | WebForms Core | Advantage |
|---|
| Initial Load | 200-500KB JS | 45KB JS | 4-10x lighter |
| Time to Interactive | 2-5 seconds | <1 second | 2-5x faster |
| Backend Complexity | High (API design) | Low (direct control) | Simpler architecture |
| Frontend Complexity | High (state management) | Minimal | Reduced cognitive load |
WebForms Core loads only a single lightweight library on the client’s first request, whereas traditional SPAs typically require downloading multiple, often large, JavaScript libraries.
Actual performance may vary depending on application complexity and deployment environment.
Seamless Integration with Existing .NET Projects
Add Package
<!-- Add to your .NET project -->
<PackageReference Include="WFC" Version="2.0.0" />
Access to NameSpase
using WebFormsCore;
Use with Minimal API
app.MapPost("/submit", async (HttpContext context) =>
{
WebForms form = new WebForms();
// Process form data
var name = context.Request.Form["name"];
// Update UI directly
form.SetText("result", $"Hello, {name}!");
form.SetBackgroundColor("result", "lightgreen");
return form.Response();
});
Use with MVC
public class HomeController : Controller
{
public IActionResult Index()
{
WebForms form = new WebForms();
form.SetGetEventListener("loadData", "click", "/api/data");
ViewBag.WebForms = form.ExportToHtmlComment();
return View();
}
}
Use with Razor Pages
public class ContactModel : PageModel
{
public IActionResult OnPost()
{
WebForms form = new WebForms();
form.Message("Thank you for your message!", "success");
form.CallSSEBack("/api/sse/event1");
return Content(form.Response());
}
}
WebForms Core Architecture
WebForms Core revolutionizes web development through a clean Commander-Executor architecture where the server acts as Commander—defining logic, events, and DOM changes—while the lightweight WebFormsJS library (just 40KB) serves as pure Executor on the client. This stateless server approach sends concise INI-formatted commands that enable direct DOM manipulation without page reloads, working seamlessly with MVC, Razor Pages, or Minimal API while maintaining full HTML standards compliance.
Unlike traditional frameworks, WebForms Core eliminates JavaScript fatigue by letting backend developers build interactive UIs using their existing skills. It supports real-time features like SSE and WebSocket natively, offers offline capabilities through Service Worker integration, and even allows client-side execution without a server.
This architecture is even suitable for games
✔️ WebForms Core can create dynamic, game-like, real-time UI
✔️ Can create animations with CSS + DOM + timer + event
✔️ Latency is acceptable for this style of interaction
✔️ Even game logic can be server-driven
However, Not ideal for frame-critical, high-frequency rendering scenarios such as canvas, WebGL, or GPU-driven animations.
To better understand where WebForms Core fits within the .NET ecosystem, the following comparison highlights practical trade-offs across common UI technologies.
Comparison with Other .NET UI Technologies
Comparison assumption: Standard web projects (Admin, LOB, Enterprise, MVP)
| Feature | Blazor | Razor Pages & MVC | WebForms Core |
|---|
| Architecture Model | Component-based, state-driven | Traditional request/response | Server-driven DOM (command-based) |
| DOM Control | Indirect (via component state) | Manual or JavaScript-based | Direct, declarative from server |
| JavaScript Dependency | Minimal (framework handles) | Extensive (developer controlled) | 40KB fixed runtime |
| Learning Curve (Backend Devs) | Moderate | Low | Very Low |
| Development Speed (Backend Team) | Medium | Fast | Very Fast |
| Frontend Skill Required | Moderate | High | Minimal |
| Real-time Support | SignalR required | Manual | Built-in (SSE + WebSocket) |
| Offline Capabilities | Limited | None | Advanced (Service Worker) |
| Performance (UI Updates) | Good (circuit chatter) | Implementation dependent | Lightweight (commands) |
| Initial Load Size | WASM: Large / Server: Medium | Small | Very Small |
| SEO & HTML Standards | Medium (mode dependent) | Excellent | Excellent (HTML-native) |
| Testing (UI Logic) | Specialized tools needed | JS testing required | Command-level testable |
| Scalability (Server) | Server: Circuit limits | Excellent | Excellent (stateless) |
| Legacy Integration | Challenging | Good | Excellent |
| Best For | Rich interactive applications | Content-heavy, SEO-first sites | Admin panels, rapid development, legacy modernization |
Getting Started with WebForms Core in .NET
Step 1 : Install the Package
dotnet add package WFC
Step 2 : Add WebFormsJS to Your Layout
<!DOCTYPE html>
<html>
<head>
+ <script type="module" src="/script/web-forms.js"></script>
</head>
<body>
<main>
@RenderBody()
</main>
</body>
</html>
Get the WebFormsJS module from this repository: https://github.com/webforms-core/Web_forms
Step 3 : Start Using in Your Controllers
using WebFormsCore;
public class InteractiveController : Controller
{
public IActionResult DynamicForm()
{
WebForms form = new WebForms();
// Build interactive UI from server
form.AddTag("<main>", "form", "userForm");
form.AddTag("userForm", "input", "username");
form.SetGetEvent("username", "onchange", "/api/validate");
return Content(form.Response());
}
}
Step 4 : Explore Advanced Features
// Progressive enhancement
public IActionResult EnhancedExperience()
{
WebForms form = new WebForms();
// Conditional UI based on capabilities
form.IsMatchMedia("(max-width: 768px)");
form.StartBracket();
form.SetClass("myMenu", "mobile-menu");
form.EndBracket();
// Async data loading
form.Async();
form.AddText("content", Fetch.LoadUrl("/api/content"));
return Content(form.Response());
}
Step 5 : Even Service Worker is Available
[HttpGet("/masterpages")]
public string MasterPage()
{
WebForms form = new WebForms();
form.ServiceWorkerRegister("/service-worker.js", "/masterpages");
form.ServiceWorkerRouteAlias("/masterpages/*", "/masterpages/layout");
form.SetMasterPagesEvent("<body>", HtmlEvent.OnLoad, "<main>");
Response.Headers["Cache-Control"] = "public,max-age=31536000";
return form.Response();
}
Security Model and Developer Control
WebForms Core adopts a security-by-configuration approach that balances flexibility with protection.
On the client side, the WebFormsJS module exposes a set of explicit security options that allow developers to restrict or completely disable potentially dangerous behaviors such as dynamic code evaluation, JavaScript injection, module loading, and method invocation
// Security configuration example
WebFormsOptions.DisableEval = false;
WebFormsOptions.DisableAppendJavaScriptTag = false;
WebFormsOptions.DisableLoadModule = false;
WebFormsOptions.UseLoadModulePathOnlyInAcceptedList = false;
WebFormsOptions.LoadModulePathOnlyInAcceptedList = ["math"];
WebFormsOptions.DisableCallMethod = false;
WebFormsOptions.UseCallMethodOnlyInAcceptedList = false;
WebFormsOptions.CallMethodOnlyInAcceptedList = ["alert"];
WebFormsOptions.DisableCallModuleMethod = false;
WebFormsOptions.UseCallModuleMethodOnlyInAcceptedList = false;
WebFormsOptions.CallModuleMethodOnlyInAcceptedList = ["confirm"];
WebFormsOptions.SendChecksum = false;
WebFormsOptions.ChecksumName = "checksum";
These options allow teams to significantly reduce XSS attack surfaces by limiting executable behaviors to an explicit allowlist.
In security-sensitive environments, dynamic execution can be fully disabled, making the client runtime operate as a strict command executor rather than a script interpreter.
Form submission and user input validation can be performed both on the server and the client using built-in validation methods such as IsRegexMatch, IsRegexNotMatch, Include, and NotInclude, enabling consistent validation rules across layers.
Ultimately, WebForms Core intentionally places security responsibility in the hands of developers, making trust boundaries explicit and configurable rather than hidden behind opaque abstractions.
Standard CSRF protections provided by the hosting framework (ASP.NET MVC, Razor Pages, Minimal API) remain fully applicable.
Note: Since WebForms Core performs direct DOM manipulation based on HTML structure, developers must explicitly configure and enforce security controls.
The Future of Server-Driven Development in .NET
Why This Matters Now
Developer Productivity : Backend teams can deliver full-stack solutions
Performance : Lightweight approach beats heavy JavaScript frameworks
Maintainability : Single codebase reduces bugs and complexity
Modern Features : Real-time, offline, testing built-in
Where WebForms Core Excels
Internal Business Applications
Admin Panels and Dashboards
Rapid Prototyping and MVPs
Legacy System Modernization
Mobile-Optimized Web Applications
WebForms Core addresses a variety of web development problems by providing a different approach. It is the hybrid innovation in the web development; a serious, production-ready solution for server-based DOM manipulation.
Note: WebForms Core technology is available for over 30 programming languages and is not exclusive to the .NET ecosystem.
The server part classes of this technology are maintained in the following repository: https://github.com/webforms-core/Web_forms_classes
Conclusion: A New Paradigm for .NET Web Development
WebForms Core on NuGet represents more than just another UI library—it's a fundamental rethinking of how server-side code can and should interact with client-side interfaces.
For .NET developers tired of JavaScript framework churn, for teams wanting to leverage existing backend expertise, for projects needing performance without complexity—WebForms Core offers a compelling alternative.
It's not about going back to the old ways. It's about moving forward with a modern, efficient, and practical approach to building web applications in the .NET ecosystem.
Key Takeaway : WebForms Core proves that server-driven development can be modern, performant, and developer-friendly. It's not just viable—it's advantageous for a wide range of real-world applications.