Skip to content

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 many patterns.

License

Notifications You must be signed in to change notification settings

elanatframework/Code_behind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 active project.
  • 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.
  • New Web-Forms: Supports a new and unique approach modeled after Microsoft's former Web-Forms.

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

API and applied methods

Information

Creating high-level systems

CodeBehind training video (On YouTube)

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

Get ready project

About

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 many patterns.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages