CodeBehind 3.9.2
Prefix Reserveddotnet add package CodeBehind --version 3.9.2
NuGet\Install-Package CodeBehind -Version 3.9.2
<PackageReference Include="CodeBehind" Version="3.9.2" />
paket add CodeBehind --version 3.9.2
#r "nuget: CodeBehind, 3.9.2"
// Install CodeBehind as a Cake Addin #addin nuget:?package=CodeBehind&version=3.9.2 // Install CodeBehind as a Cake Tool #tool nuget:?package=CodeBehind&version=3.9.2
CodeBehind Framework
CodeBehind is a modern back-end framework under ASP.NET Core. CodeBehind was developed by Elanat in 2023 and competes with Microsoft's default web frameworks (ASP.NET Core MVC and Razor Pages and Blazor). CodeBehind is an engineering masterpiece that simultaneously provides the possibility of development based on MVC, Model-View, Controller-View, only View and Web-Forms. The type of structure and naming in CodeBehind is a nostalgia that reminds of former Microsoft Web-Forms.
The aspx extension is the files of the view section in the CodeBehind framework and they supports standard syntax (<%=Standard%>
) and Razor syntax (@Razor
). This framework guarantees the separation of server-side codes from the design part (html) and there is no need to write server-side codes in the view.
Code Behind framework inherits every advantage of ASP.NET Core and gives it more simplicity, power, flexibility and has high serverside independence.
CodeBehind framework is an alternative to ASP.NET Core.
Why use CodeBehind?
- Fast: The CodeBehind framework is faster than Microsoft's default web frameworks (ASP.NET Core MVC and Razor Pages).
- Simple: Developing with CodeBehind is very simple. You can use MVC pattern or Model-View or Controller-View or only View.
- Modular: It is modular. Just copy the new project files, including DLL and aspx, into the current published project (plug and play).
- Get output: You can call the output of the aspx page in another aspx page and modify its output.
- Under .NET Core: Your project will still be under ASP.NET Core and you will benefit from all the benefits of .NET Core.
- Code-Behind: Code-Behind pattern will be fully respected.
- Modern: CodeBehind is a modern framework with revolutionary ideas.
- Understandable: View is preferable to Controller and there is no need to set Controllers in route.
- Adaptable: The CodeBehind framework can even be used with Razor Pages and ASP.NET Core MVC.
- Loose coupling: The different components of CodeBehind work independently of each other.
- RAD: Everything is automated in CodeBehind framework, just focus on development.
- WebForms Core technology: Supports a new and unique approach modeled after Microsoft's former WebForms.
- Full Stack: Manage both back-end and front-end together; you can manage HTML tags from the server-side.
CodeBehind is .NET Diamond!
In every scenario, CodeBehind performs better than the default structure in ASP.NET Core.
Only view example
View section: aspx page (razor syntax)
@page
@{
Random rand = new Random();
}
<div>
<h1>Random value: @rand.Next(1000000)</h1>
</div>
View section: aspx page (standard syntax)
<%@ Page %>
<%
Random rand = new Random();
%>
<div>
<h1>Random value: <%=rand.Next(1000000)%></h1>
</div>
MVC example
View File: Default.aspx (razor syntax)
@page
@controller MyController
@model MyModel
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@model.PageTitle</title>
</head>
<body>
@model.BodyValue
</body>
</html>
View File: Default.aspx (standard syntax)
<%@ Page Controller="MyController" Model="MyModel" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><%=model.PageTitle%></title>
</head>
<body>
<%=model.BodyValue%>
</body>
</html>
Model File: Default.aspx.Model.cs
using CodeBehind;
public partial class MyModel : CodeBehindModel
{
public string PageTitle { get; set; }
public string BodyValue { get; set; }
}
Controller File: Default.aspx.Controller.cs
using CodeBehind;
public partial class MyController : CodeBehindController
{
public void PageLoad(HttpContext context)
{
MyModel model = new MyModel();
model.PageTitle = "My Title";
model.BodyValue = "HTML Body";
View(model);
}
}
CodeBehind Configure in ASP.NET Core
Program File: Program.cs
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
SetCodeBehind.CodeBehindCompiler.Initialization();
app.UseCodeBehind();
app.Run();
Documents
Programming
- Simple and structured MVC in CodeBehind
- It is not necessary to follow the MVC pattern
- Load aspx page finally result in another aspx page
- Examples of development
- Send data
- Web part in CodeBehind
- Razor syntax reference for CodeBehind framework
- Standard syntax reference for CodeBehind framework
- Constructor method
- HtmlData classes
- Template
- Transfer template block data in ViewData
- Layout
- Section
- Error handling
- Options
- Namespace and DLL for CodeBehind view class
- Manage roles in CodeBehind (Authentication and Authorization)
- Use cache
- Controller class constructor and Model class constructor
- Using Web-Forms
- Error detection
- How to use CodeBehind?
- Route configuration
- Used with Razor Pages and ASP.NET Core MVC
- Modularity in the default mode
- Modularity in the configuration of the controller in the route
API and applied methods
Information
- New features on new versions
- How is the list of views finally made?
- CodeBehind framework data
- MVC architecture in CodeBehind
- Performance test, ASP.NET Core MVC and Razor Pages vs CodeBehind Framework in version 2.2
- Performance test in only view section in version 1.5.2 (ASP.NET Core VS CodeBehind)
- CodeBehind story
- ASP.NET Core VS CodeBehind; why should we use CodeBehind?
- CodeBehind framework vs Code-Behind pattern
Creating high-level systems
- How to create modular systems by CodeBehind framework?
- How to create scheduled task system by CodeBehind framework?
- How to create startup system by CodeBehind framework?
- How to create dynamic middleware system by CodeBehind framework?
CodeBehind training video (On YouTube)
- Video 1- Hello World!
- Video 2- Set dynamic header
- Video 3- Page list in default page
- Video 4- How to use CodeBehind framework?
- Video 5- Advanced programming with return template
- Video 6- Using WebForms Core
Download CodeBehind
Get from Elanat website:
https://elanat.net/category/download_code_behind/
Get from GitHub:
https://github.com/elanatframework/Code_behind/releases
Get from Nuget (We added CodeBehind in Nuget so that you can access it easily):
https://www.nuget.org/packages/CodeBehind
Ready project
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Microsoft.CodeAnalysis.CSharp (>= 4.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.9.2 | 215 | 12/8/2024 |
3.9.1 | 136 | 12/3/2024 |
3.9.0 | 122 | 11/29/2024 |
3.8.0 | 266 | 11/10/2024 |
3.7.2 | 204 | 10/22/2024 |
3.7.1 | 133 | 10/19/2024 |
3.7.0 | 136 | 10/14/2024 |
3.6.1 | 298 | 9/30/2024 |
3.6.0 | 401 | 9/9/2024 |
3.5.0 | 125 | 9/4/2024 |
3.4.1 | 205 | 8/27/2024 |
3.4.0 | 150 | 8/27/2024 |
3.3.0 | 165 | 8/24/2024 |
3.2.2 | 148 | 8/23/2024 |
3.2.1 | 168 | 8/16/2024 |
3.2.0 | 129 | 8/15/2024 |
3.1.0 | 132 | 8/15/2024 |
3.0.0 | 211 | 7/30/2024 |
2.9.2 | 111 | 7/24/2024 |
2.9.1 | 108 | 7/24/2024 |
2.9.0 | 105 | 7/22/2024 |
2.8.0 | 212 | 6/29/2024 |
2.7.1 | 266 | 6/16/2024 |
2.7.0 | 139 | 6/16/2024 |
2.6.0 | 150 | 6/10/2024 |
2.5.1 | 111 | 6/9/2024 |
2.5.0 | 218 | 5/20/2024 |
2.4.3 | 154 | 5/12/2024 |
2.4.2 | 187 | 3/31/2024 |
2.4.1 | 112 | 3/31/2024 |
2.4.0 | 194 | 3/5/2024 |
2.3.0 | 129 | 2/17/2024 |
2.2.0 | 152 | 1/26/2024 |
2.1.2 | 167 | 1/6/2024 |
2.1.1 | 122 | 1/5/2024 |
2.1.0 | 115 | 1/5/2024 |
2.0.0 | 178 | 12/23/2023 |
1.9.3 | 141 | 12/18/2023 |
1.9.2 | 158 | 12/9/2023 |
1.9.1 | 127 | 12/2/2023 |
1.9.0 | 142 | 11/30/2023 |
1.8.1 | 137 | 11/27/2023 |
1.8.0 | 133 | 11/26/2023 |
1.7.0 | 180 | 10/18/2023 |
1.6.1 | 149 | 10/18/2023 |
1.6.0 | 150 | 10/18/2023 |
1.5.2 | 169 | 9/28/2023 |
1.5.1 | 164 | 9/19/2023 |
1.5.0 | 139 | 9/13/2023 |
1.4.3 | 164 | 9/3/2023 |
1.4.2 | 173 | 8/30/2023 |
1.4.1 | 191 | 8/26/2023 |
1.4.0 | 144 | 8/23/2023 |
1.3.2 | 156 | 8/12/2023 |
1.3.1 | 161 | 8/12/2023 |
1.3.0 | 156 | 8/12/2023 |
1.2.0 | 182 | 7/24/2023 |
1.1.1 | 180 | 7/4/2023 |
1.1.0 | 172 | 7/3/2023 |
1.0.0 | 217 | 6/30/2023 |