AspNetCore.Docs/aspnetcore/includes/mvc-intro/adding-model3.md

1.7 KiB

no-loc
Home
Privacy
Kestrel
appsettings.json
ASP.NET Core Identity
cookie
Cookie
Blazor
Blazor Server
Blazor WebAssembly
Identity
Let's Encrypt
Razor
SignalR

Test the app

  • Run the app and tap the Mvc Movie link.

  • Tap the Create New link and create a movie.

    Create view with fields for genre, price, release date, and title

  • You may not be able to enter decimal points or commas in the Price field. To support jQuery validation for non-English locales that use a comma (",") for a decimal point, and non US-English date formats, you must take steps to globalize your app. See https://github.com/dotnet/AspNetCore.Docs/issues/4076 and Additional resources for more information. For now, just enter whole numbers like 10.

  • In some locales you need to specify the date format. See the highlighted code below.

[!code-csharp]

We'll talk about DataAnnotations later in the tutorial.

Tapping Create causes the form to be posted to the server, where the movie information is saved in a database. The app redirects to the /Movies URL, where the newly created movie information is displayed.

Movies view showing newly created movie listing

Create a couple more movie entries. Try the Edit, Details, and Delete links, which are all functional.