CodeBehind 1.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package CodeBehind --version 1.0.0
                    
NuGet\Install-Package CodeBehind -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeBehind" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeBehind" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CodeBehind" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodeBehind --version 1.0.0
                    
#r "nuget: CodeBehind, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CodeBehind@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeBehind&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CodeBehind&version=1.0.0
                    
Install as a Cake Tool

Code_behind

This library is a programming model based on the MVC structure, which provides the possibility of creating dynamic aspx files (similar to standard .NET) in .NET Core and has high Serverside independence. Soon we will expand this project so that in future versions you can experience both MVC and Code-Behind without coding in the view.


Model File: Default.aspx.Model.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CodeBehind;

namespace YourProjectName.wwwroot { public partial class DefaultModel : CodeBehindModel { public string PageTitle { get; set; } public string BodyValue { get; set; } } }


View File: Default.aspx <%@ Page Controller="YourProjectName.wwwroot.DefaultController" Model="YourProjectName.wwwroot.DefaultModel" %><!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title><%=model.PageTitle%></title> </head> <body> <%=model.BodyValue%> </body> </html>


Controler File: Default.aspx.Controller.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CodeBehind;

namespace YourProjectName.wwwroot { public partial class DefaultController : CodeBehindController { public DefaultModel model = new DefaultModel(); public void PageLoad(HttpContext context) { model.PageTitle = "My Title"; model.BodyValue = "HTML Body"; View(model); } } }


Program File: Program.cs using CodeBehind; using SetCodeBehind;

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

// Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); }

CodeBehindCompiler.Initialization();

app.Run(async context ⇒ { CodeBehindExecute execute = new CodeBehindExecute(); await context.Response.WriteAsync(execute.Run(context)); });

app.UseHttpsRedirection(); app.UseStaticFiles();

app.UseRouting();

app.Run();

Product 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.2.0 198 6/25/2025
4.1.1 197 5/1/2025
4.1.0 208 3/22/2025
4.0.0 303 1/29/2025
3.9.2 368 12/8/2024
3.9.1 194 12/3/2024
3.9.0 187 11/29/2024
3.8.0 320 11/10/2024
3.7.2 261 10/22/2024
3.7.1 176 10/19/2024
3.7.0 390 10/14/2024
3.6.1 387 9/30/2024
3.6.0 2,096 9/9/2024
3.5.0 179 9/4/2024
3.4.1 274 8/27/2024
3.4.0 196 8/27/2024
3.3.0 216 8/24/2024
3.2.2 196 8/23/2024
3.2.1 209 8/16/2024
3.2.0 181 8/15/2024
3.1.0 189 8/15/2024
3.0.0 261 7/30/2024
2.9.2 159 7/24/2024
2.9.1 152 7/24/2024
2.9.0 157 7/22/2024
2.8.0 266 6/29/2024
2.7.1 312 6/16/2024
2.7.0 192 6/16/2024
2.6.0 194 6/10/2024
2.5.1 155 6/9/2024
2.5.0 263 5/20/2024
2.4.3 207 5/12/2024
2.4.2 241 3/31/2024
2.4.1 162 3/31/2024
2.4.0 242 3/5/2024
2.3.0 172 2/17/2024
2.2.0 200 1/26/2024
2.1.2 214 1/6/2024
2.1.1 178 1/5/2024
2.1.0 155 1/5/2024
2.0.0 223 12/23/2023
1.9.3 189 12/18/2023
1.9.2 200 12/9/2023
1.9.1 167 12/2/2023
1.9.0 172 11/30/2023
1.8.1 172 11/27/2023
1.8.0 175 11/26/2023
1.7.0 228 10/18/2023
1.6.1 190 10/18/2023
1.6.0 189 10/18/2023
1.5.2 214 9/28/2023
1.5.1 198 9/19/2023
1.5.0 187 9/13/2023
1.4.3 211 9/3/2023
1.4.2 216 8/30/2023
1.4.1 240 8/26/2023
1.4.0 197 8/23/2023
1.3.2 222 8/12/2023
1.3.1 212 8/12/2023
1.3.0 211 8/12/2023
1.2.0 242 7/24/2023
1.1.1 234 7/4/2023
1.1.0 234 7/3/2023
1.0.0 280 6/30/2023