ASP.NET 5 is ready for production! Microsoft has released RC1 with a go-live license. If you're planning to start a new project, ASP.NET 5 offers a cross-platform development experience that enables you to not only develop the application in a Windows\MAC\Linux environment, but also allows you to host the application on a Windows server or on Linux. In addition, ASP.NET 5 provides a host of new features that makes web development very easy.
The latest ASP.NET 5 tools and runtime can be downloaded from get.asp.net. You have options to choose the tools for Windows, MAC or Linux systems. Read more in the in-progress documentation.
C1Studio ASP.NET MVC Edition controls are fully compatible with MVC6. Moreover, these controls can be used with both full CLR and core CLR. The controls offer a unique option to use, HtmlHelpers, TagHelpers or both. We've released ASP.NET 5 RC-compatible builds through the GrapeCity Nuget, and you can get ASPNET MVC Edition by downloading C1Studio.
ASP.NET 5's web application organization has changed drastically. Some highlights include:
The Project.JSON file is used to define project server side dependencies and other settings.
This folder is the root of the web application; it also stores all static files. The wwwroot folder is the default web root folder, and the specific web root folder can be configured in project.json.
The server side dependency is handled by references in the Solution Explorer. It contains dependency for each CLR runtime, i.e, full and core CLR. It has two types of dependencies: assemblies and Nuget packages.
Server Side Dependency Management
ASP.NET 5 has a modular architecture wherein we can opt in the services required in the project. This makes a lean architecture with small footprint. The Startup.cs files has two methods:
The project can target different frameworks and their versions. For example, you could target the project to use full CLR or core CLR.
TagHelpers are new to MVC, and we've been supporting it since Beta4. TagHelpers allow you to declare MVC controls in a style closely related to markup. Visual Studio provides IntelliSense and color formatting that makes writing Razor code easy. You no longer need to use escape sequences like "@" to write some html or CSS class in the razor code, but you still get the advantage of jumping to C# inside quotes.
Here's a small example of how a label is declared using HtmlHelper and TagHelper. Notice how clean the TagHelper code looks—it's as if you're writing mark-up.
@Html.Label("FirstName", "First Name:", new {@class="caption"})
This example demonstrates a Form with various input elements. Notice that form has a asp-for attribute; this sets the controller action to the form. You'll also notice that each control has a "for" attribute, which sets the model property to which the control is bound. We can set variables from the ViewBag inside the quotes, as well. For example, refer the item-source of C1AutoComplete control. It sets the source-collection attribute to "countries" variable, which itself is a List of countries.
Let's see some advance control examples:
allow-sorting="@Convert.ToBoolean(optionsModel.Options["Allow Sorting"].CurrentValue)"
selection-mode="@((SelectionMode)Enum.Parse(typeof(SelectionMode), optionsModel.Options["Selection"].CurrentValue))">
is-visible="@(string.Compare(optionsModel.Options["Column Visibility"].CurrentValue, "show", true) == 0)">
format="@(optionsModel.Options["Formatting"].CurrentValue == "On" ? "MMM d yy" : "")">
format="@(optionsModel.Options["Formatting"].CurrentValue == "On" ? "HH:mm" : "")">
width="@optionsModel.Options["Column Resize"].CurrentValue">