GoldSim / Website

Source code for the GoldSim.com website
https://www.goldsim.com/
3 stars 1 forks source link

Create Form Views #12

Closed JeremyCaney closed 4 years ago

JeremyCaney commented 4 years ago

Establish new ASP.NET Core views to provide the user interface for the forms.

Current Approach

The current forms use ASP.NET WebForm Web Controls wrapped up in User Controls to expose the user interface, centralize reusable components, and provide both client- and server-side form validation.

New Approach

With ASP.NET Core, the forms will now use standard MVC views. Reusable components can be handled via either partial views or—if they need to be parameterized—Razor components or view components. Form validation can now be handled using a combination of POCO attribute annotations as well as Microsoft’s jQuery-Validation-Unobtrustive library for client-side validation. With ASP.NET Core 3.0 specifically, the input controls can now use the built-in Razor components.

Research

Steps (Application)

Partial views

Forms

Issues

This will likely represent the largest effort in the forms migration, since much of the legacy code won’t translate to the new format.

JeremyCaney commented 4 years ago

Question: "Determine functional differences between <partial for />, <partial model /> and @Html.EditorFor()"

Html.EditorFor(o => o.BindingModel.Trainer, "Contact", "BindingModel.Trainer", null)

<partial name="Contact" for="BindingModel.Trainer" />

<partial name="Contact" model="Model.BindingModel.Trainer" />

Given this, my recommendation is that we use <partial for /> on GoldSim, as it uses declarative markup, correctly interprets the HTML field name, and supports nested complex objects.