Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C# Asp.net Core MVC in Visual Studio. 18 Student projects for Murachs ASP.NET Core MVCProject 8-1 Build the Trips Log app For this project,

Using C# Asp.net Core MVC in Visual Studio. 18 Student projects for Murachs ASP.NET Core MVCProject 8-1 Build the Trips Log app For this project, you will build a data-driven web app that uses view models to pass data from controllers to views, the ViewBag object to pass data from views to the layout, and TempData to persist data between requests.

19 Student projects for Murachs ASP.NET Core MVCSpecifications xWhen the app starts, it should display trip data and an Add Trip link. xThe layout for this web app should display a banner at the top of the page, and a subhead below it. However, the subhead should only display if theres text in the ViewData property for it. xWhen the user clicks the Add Trip link, a three page data entry process should start. xOn the first page, the user should enter data about the trip destination and dates. The Accommodations field on this page should be optional, and the rest should be required. xThe second page should only display if the user entered a value for the Accommodations field on the first page. On this page, the user should enter data about the accommodations. The accommodation value the user entered should display in the subhead, and the fields should be optional. xOn the third page, the user should enter data about things to do on their trip. The destination the user entered on the first page should display in the subhead, and the fields should be optional. xWhen the user clicks the Next button on the first or second page, the web app should save the data posted from the page in TempData. Use this data to get the user entries to display in the subheads as needed, but make sure any data that needs to be saved to the database persists in TempData. xWhen the user clicks the Save button on the third page, the web app should save the data posted from the page and the data in TempData to the database. Then, the Home page should display with a temporary message that the trip has been added. xWhen the user clicks the Cancel button on any of the Add pages, the data in TempData should be cleared and the Home page should display. You can use this statement to clear the data: TempData.Clear();xTo keep things simple, store all fields for the trip in a single table like this:

public int? TripId { get; set; } public string Destination { get; set; } [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] [Display(Name = "Start Date")] public DateTime StartDate { get; set; } [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] [Display(Name = "End Date")] public DateTime EndDate { get; set; } public string Accomodation { get; set; } public string AccomodationPhone { get; set; } public string AccomodationEmail { get; set; } public string ThingToDo1 { get; set; } public string ThingToDo2 { get; set; } public string ThingToDo3 { get; set; }

I just can't figure out the routing/viewa/temp data setup. this assignment uses core MVC

image text in transcribed

W Project 8-1 Build the Trips Log app For this project, you will build a data-driven web app that uses view models to pass data from controllers to views, the ViewBag object to pass data from views to the layout, and TempData to persist data between requests. My Trip Log localhost:5001 * My Trip Log Add Trip Destination Start Date End Date Accommodations Things To Do Boise 6/6/2020 6/14/2020 Visit Tammy Portland 1/1/2021 1/7/2021 The Benson Hotel Phone: 503-555-1234 Email: staff@bensonhotel.com Go to Voodoo Doughnuts Walk in the rain Go to Powell's Add Trip - Page 1 localhost:5001/Trip/Add My Trip Log Add Trip Destination and Dates Destination Add Trip - Page 2 W Project 8-1 Build the Trips Log app For this project, you will build a data-driven web app that uses view models to pass data from controllers to views, the ViewBag object to pass data from views to the layout, and TempData to persist data between requests. My Trip Log localhost:5001 * My Trip Log Add Trip Destination Start Date End Date Accommodations Things To Do Boise 6/6/2020 6/14/2020 Visit Tammy Portland 1/1/2021 1/7/2021 The Benson Hotel Phone: 503-555-1234 Email: staff@bensonhotel.com Go to Voodoo Doughnuts Walk in the rain Go to Powell's Add Trip - Page 1 localhost:5001/Trip/Add My Trip Log Add Trip Destination and Dates Destination Add Trip - Page 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions