XCST web pages for ASP.NET Core
This repository provides integration of XCST with ASP.NET Core for web application development. It includes a set of extension instructions known as the "application extension" based on the HTML helpers from ASP.NET MVC 5.
See the project home for more information.
Package | Description | Targets |
---|---|---|
Xcst.AspNetCore | XCST web pages for ASP.NET Core. | .NET 7 |
Xcst.AspNetCore.Extension | Extension instructions for XCST web pages. | .NET 5 |
The documentation can be found at the project home.
v2 is the main branch for major version 2. See v1 for version 1 (no longer maintained).
Support for ASP.NET 4 (.NET Framework) was dropped in v2, focusing on ASP.NET Core going forward. As a consequence, the number of NuGet packages was reduced from six to two.
The runtime on v2 is much more integrated with ASP.NET Core. Functionality that was previously copied from ASP.NET MVC 5 such as model metadata, model binding, model validation, anti-forgery, etc. is now reused from ASP.NET Core.
The extension on v2 can generate code for runtime v1 or v2 (the default). This not only accounts for runtime API changes, but the extension instructions and attributes also. For example, if v2 removes an attribute, it will be available if you target v1. On the other hand, new instructions and attributes on v2 are not supported when targeting v1. To put it simply, the extension is backwards compatible, but you must explicitly target v1. You are therefore encouraged to use the v2 extension and XCST's v2 compiler to maintain your legacy v1 apps.
- Removed 'attributes' attribute from all html instructions (can now use sequence constructor to add attributes)
- Not using ViewDataDictionary value on form instructions
- Not adding blank option on a:select (a:editor still does)
- Not looking for options in ViewData on a:select
- Not prepending new line on a:textarea when value is empty
- Adding 'readonly' and 'placeholder' on a:input and a:textarea based on metadata
- Using more specific type on a:input based on metadata
- Default format on a:input
- Ignoring Html5DateRenderingMode
- Text-only sequence constructor for a:with-options/a:option
- Renamed a:model's 'as' attribute to 'type'
- Using single Number template for integral types
The runtime has lots of changes, including renamed namespaces and moved types. These are the most notable changes:
- Removed RouteValueDictionary dependency from ObjectToDictionary and AnonymousObjectToHtmlAttributes
- Removed TempData
- Removed ViewBag
- Renamed XcstPage.Context to HttpContext
- Removed XcstPageHandler, moved RenderPage to XcstPage
The application extension schema is written in Relax NG and converted to XSD using Trang, which requires Java.