COIT12204 Web Site Design

Assignment 2 Guide – Part 1

Getting started
  • Download the assignment 2 resources files
  • Copy and replace the updated styles.css
  • You may find some in some situations images and the css does not display. To fix this add a slash at the start of the path for images and also for the css files

i.e. for the Layout.cshtml

    <link rel=”icon” href=”/img/Fevicon.png” type=”image/png”>

    <link rel=”stylesheet” href=”/lib/twitter-bootstrap/css/bootstrap.min.css”>

    <link rel=”stylesheet” href=”/lib/font-awesome/css/font-awesome.min.css”>

    <link rel=”stylesheet” href=”/css/style.css”>

Database
  • In the product model uncomment the tag for price as we need to set the db column type
    • Right click on the error and import the annotation library
Install Database Packages
  • Add the database packages and tools by following Listing 7.12 to 7.13 in Chapter 7 of the text (see note below if there are problems)
  • Note that you MUST change into the project folder (the one with the yourprojectname.csproj)
    • You cannot run this from the solution folder

Note: If you DO NOT have the 3.1 SDK installed it may complain in Listing 7.12, depending what SDK you specified

  • If this occurs try the following steps
  • Use dotnet –list-sdks or dotnet –info to check your version
  • Then open global.json in the root folder and check the version
  • Change global.json from 3.1.x to your later version

“sdk”: {

  “version”: “5.0.302”  (use your SDK version here)

}

  • Note: if you changed the version you MUST run the app to update the project SDK before the next step
  • Now you can do Listing 7.12 and Listing 7.13
Migration
  • Make sure you hit Save All before running the migrate command
    • If the model is not saved it will not see it to build the migration file
    • If you have a problem open that the migration file and check that the create database and create table commands are there
  • If there is a problem with the migrate, just delete the migrations folder and rerun the migrate command again
  • Note that the database itself is not actually created until later
Database Connection
  • In Listing 7.14 you need to change the database name and the connection name to suit your project name

“ConnectionStrings”: {

    “YourConnectionName“: “Server=(localdb)\\MSSQLLocalDB;Database= YourDbName

DbContext and Repository
  • Do Listing 7.15 to 7.20
  • Note: You will need to change the namespaces to suit your project in most files that you create from the code in the textbook
  • In startup.cs use your connection name
Seed Data
  • In Listing 7.21 move the seed data from the Catalogue controller sample data method into SeedData.cs
  • Note the different format for the Products.AddRange() command
  • Add the seed data call to startup.cs as in Listing 7.22 (this will migrate the database)
  • Delete the old sample data method in the Catalogue controller
Test

Run the project and check that the database has been created

  • View => SQL Server Object Explorer => SQL Server => (localdb)MSSQLLocalDB … => Databases
  • You can also delete the database from here if required (right click on the database)
    • Check Close existing connection when it asks
    • Then rerun the app to recreate (migrate) the database (in SeedData.cs)
Catalogue
  • Adapt the code from Listing 7.23 and inject the store repository into the Catalogue controller
    • Change the constructor name from Home controller to CatalogueController
    • Don’t forget to delete the sampleData() method if you haven’t already
  • Fetch the product list using the repository and pass it to the view
  • Note that the repository returns an iQueryable but the view currently expects a List
    • So, change the model data type in the view to iQueryable<Product>
Test
  • Test that the catalogue page now loads from the database
Catalogue Product Filter
  • Follow the steps below to populate the side menu categories dynamically from the database
  • First you must add the following to _ViewImports.cs as we will be using our own tag helper
    • @addTagHelper *, SportsStore (use your namespace instead of SportsStore)
  • Create the Nav component as in Listing 8.6
  • For listing 8.7 replace the side menu in the Catalogue view (NOT in _Layout as per the text)
    • Delete the <ul> tag and content within it under the Browse Categories heading (head class)
    • This generated the old static menu, but we are not using it
    • Put the nav component under Browse Categories within the sidebar-categories div
Test
  • Run and check that the nav menu displays the sample text in place of the menu
Nav Menu
  • Next use Listing 8.8 and 8.9 to add the category buttons to the menu
  • For Listing 8.9 note that you have to create both the Components folder and the NavigationMenu sub folder (otherwise it won’t find the view if path is not correct)
  • Also in Listing 8.9 change the route parameters to go to the Catalogue controller Index method with the category parameter as shown below
  • And remove asp-route-productPage=”1″ as we are not using paging
    • Note don’t delete the closing >
  • Type these changes into the existing code to match the code below (rather than cutting and pasting the code itself)

    <a class=”btn btn-block btn-outline-secondary”

       asp-action=”Index” asp-controller=”Catalogue”

       asp-route-category=”@category”>

Test
  • Run and check that the nav menu contains the categories (it will not filter yet)
Add the Product filter
  • Modify the Catalogue controller Index method to filter the products that are displayed using the code below
  • Here we are adding the category parameter we added above to the route to the Catalogue Index method parameters and using it to filter the product list from the repository
  • Note you will need to import Linq to fix the error

public IActionResult Index(string category = null)

{

    ViewBag.pageName = “Catalogue”;

    return View(repository.Products

        .Where(p => category == null || p.Category == category));

}

Test
  • Run and check that the products are filtered by category
Set the Current Nav Item
  • In the Nav Component load the current category into the viewbag to set the nav button
    • See Listing 8.10 and add the additional line to the Nav Component invoke() method

ViewBag.SelectedCategory = RouteData?.Values[“category”];

  • We also need set a route to pass the category back to the Catalogue controller
  • We could do it in startup.cs as before
  • However, there is a simpler way to define routes in the controller (uses a TagHelper)
  • In the Catalogue controller above the index method add the two routes below (one with a category and one without)

        [Route(“Catalogue”)]

        [Route(“Catalogue/{category}”)]

        public IActionResult Index(string category = null)

        {   …

  • In the Nav Component view file
    • View/Shared/Components/NavigationMenu/Default.cshtml
  • Add the code to highlight the current category using the category we stored in the viewbag
  • Change   

<a class=”btn btn-block btn-outline-secondary”

to

       <a class=”btn btn-block

       @(category == ViewBag.SelectedCategory

           ? “btn-primary”: “btn-outline-secondary”)”

  • If the images disappear from the Catalogue page add a slash in front of the image path in the View/Shared/ProductSummary.cshtml

<img class=”card-img” src=”/img/product/@Model.Image” alt=””>

Test
  • Run and check that the current category is highlighted

Move on to the Assignment 2 Guide Part 2

Order Now
No Fields Found.
Universal Assignment (April 5, 2026) COIT12204 Web Site Design. Retrieved from https://universalassignment.com/coit12204-web-site-design/.
"COIT12204 Web Site Design." Universal Assignment - April 5, 2026, https://universalassignment.com/coit12204-web-site-design/
Universal Assignment June 22, 2022 COIT12204 Web Site Design., viewed April 5, 2026,<https://universalassignment.com/coit12204-web-site-design/>
Universal Assignment - COIT12204 Web Site Design. [Internet]. [Accessed April 5, 2026]. Available from: https://universalassignment.com/coit12204-web-site-design/
"COIT12204 Web Site Design." Universal Assignment - Accessed April 5, 2026. https://universalassignment.com/coit12204-web-site-design/
"COIT12204 Web Site Design." Universal Assignment [Online]. Available: https://universalassignment.com/coit12204-web-site-design/. [Accessed: April 5, 2026]

Please note along with our service, we will provide you with the following deliverables:

Please do not hesitate to put forward any queries regarding the service provision.

We look forward to having you on board with us.

Categories

Get 90%* Discount on Assignment Help

Most Frequent Questions & Answers

Universal Assignment Services is the best place to get help in your all kind of assignment help. We have 172+ experts available, who can help you to get HD+ grades. We also provide Free Plag report, Free Revisions,Best Price in the industry guaranteed.

We provide all kinds of assignmednt help, Report writing, Essay Writing, Dissertations, Thesis writing, Research Proposal, Research Report, Home work help, Question Answers help, Case studies, mathematical and Statistical tasks, Website development, Android application, Resume/CV writing, SOP(Statement of Purpose) Writing, Blog/Article, Poster making and so on.

We are available round the clock, 24X7, 365 days. You can appach us to our Whatsapp number +1 (613)778 8542 or email to info@universalassignment.com . We provide Free revision policy, if you need and revisions to be done on the task, we will do the same for you as soon as possible.

We provide services mainly to all major institutes and Universities in Australia, Canada, China, Malaysia, India, South Africa, New Zealand, Singapore, the United Arab Emirates, the United Kingdom, and the United States.

We provide lucrative discounts from 28% to 70% as per the wordcount, Technicality, Deadline and the number of your previous assignments done with us.

After your assignment request our team will check and update you the best suitable service for you alongwith the charges for the task. After confirmation and payment team will start the work and provide the task as per the deadline.

Yes, we will provide Plagirism free task and a free turnitin report along with the task without any extra cost.

No, if the main requirement is same, you don’t have to pay any additional amount. But it there is a additional requirement, then you have to pay the balance amount in order to get the revised solution.

The Fees are as minimum as $10 per page(1 page=250 words) and in case of a big task, we provide huge discounts.

We accept all the major Credit and Debit Cards for the payment. We do accept Paypal also.

Popular Assignments

Professional Nursing Assignment Help for Students: Achieve Academic Excellence with Expert Support

Introduction Nursing is a demanding field that combines theoretical knowledge with practical skills. Students pursuing nursing courses often face challenges in completing assignments that require accuracy, critical thinking, and real-world application. This is where nursing assignment help becomes an essential academic support system. With increasing academic pressure and clinical responsibilities,

Read More »

Economics Assignment Help: A Complete Guide for Students

Introduction Economics is a fundamental subject that helps students understand how markets, governments, and individuals make decisions regarding resources. While it is highly relevant in today’s world, many students find economics assignments challenging due to complex theories, graphs, and data analysis. This is where economics assignment help becomes extremely useful.

Read More »

Law Assignment Help: A Complete Guide for Students

Introduction Law is a complex and intellectually demanding field that requires critical thinking, analytical skills, and a deep understanding of legal principles. Students pursuing law often face challenges in completing assignments due to extensive research requirements and intricate case analysis. This is where law assignment help becomes highly beneficial. With

Read More »

Nursing Assignment Help: A Complete Guide for Students

Introduction Nursing is a highly respected and demanding field that requires a strong understanding of medical concepts, patient care, and clinical practices. Students pursuing nursing often face intense academic pressure due to complex assignments, practical responsibilities, and tight deadlines. This is where nursing assignment help becomes essential. With expert assistance,

Read More »

Finance Assignment Help: A Complete Guide for Students

Introduction Finance is a core subject in business and management studies, covering areas like investment analysis, financial management, and risk assessment. While it offers excellent career opportunities, many students find finance assignments challenging due to complex calculations and analytical concepts. This is where finance assignment help becomes essential. With expert

Read More »

Computer Science Assignment Help: A Complete Guide for Students

Introduction Computer Science is one of the most popular and dynamic fields of study, offering vast career opportunities in software development, data analysis, cybersecurity, and more. However, students often face difficulties in completing assignments due to the technical complexity and time constraints. This is where computer science assignment help becomes

Read More »

Digital Marketing Assignment Help: A Complete Guide for Students

Introduction Digital marketing has become a vital part of modern business strategies, making it a popular subject among students worldwide. From social media campaigns to search engine optimization, the field is dynamic and constantly evolving. However, completing assignments in this subject can be challenging due to its practical and analytical

Read More »

Cloud Computing Assignment Help: A Complete Guide for Students

Introduction Cloud computing has become a fundamental part of modern technology, powering everything from mobile apps to enterprise systems. As universities increasingly include this subject in their curriculum, students often find it challenging to keep up with assignments and projects. This is where cloud computing assignment help becomes essential. With

Read More »

Blockchain Assignment Help: A Complete Guide for Students

Introduction Blockchain technology has rapidly gained popularity across industries such as finance, healthcare, and supply chain management. As a result, it has become an important subject in academic programs worldwide. However, students often struggle with its technical concepts and practical applications. This is where blockchain assignment help becomes highly valuable.

Read More »

Data Science Assignment Help: A Complete Guide for Students

Introduction Data Science has become one of the most in-demand fields in today’s digital era, combining statistics, programming, and analytical thinking. However, many students find it difficult to keep up with the complexity of assignments and projects in this subject. This is where data science assignment help plays a crucial

Read More »

Artificial Intelligence Assignment Help: A Complete Guide for Students

Introduction Artificial Intelligence (AI) is transforming industries across the globe, making it one of the most sought-after academic subjects today. However, mastering AI concepts and completing assignments can be challenging for many students. This is where artificial intelligence assignment help becomes essential. With expert guidance, students can better understand complex

Read More »

Assignment Writing Services: A Complete Guide for Students

Introduction Assignments are a crucial part of academic life, helping students develop knowledge, research skills, and critical thinking. However, managing multiple assignments along with exams and personal responsibilities can be overwhelming. This is where assignment writing services become highly beneficial. These services provide expert assistance, helping students complete their assignments

Read More »

Blockchain Assignment Help: A Complete Guide for Students

Introduction Blockchain technology has emerged as one of the most revolutionary innovations in recent years. From cryptocurrencies to secure data management, blockchain is transforming industries like finance, healthcare, and supply chain. Students studying blockchain often face challenges due to its technical concepts and real-world applications. This is where blockchain assignment

Read More »

Assignment Writing Services: A Complete Guide for Students

Introduction Assignments are a crucial part of academic life, helping students develop knowledge, research skills, and critical thinking. However, managing multiple assignments along with exams and personal responsibilities can be overwhelming. This is where assignment writing services become highly beneficial. These services provide expert assistance, helping students complete their assignments

Read More »

Academic Writing Services: A Complete Guide for Students

Introduction Academic writing is a fundamental part of education, requiring students to produce essays, research papers, case studies, and dissertations. It demands strong writing skills, proper structure, and in-depth research. However, many students struggle with academic writing due to time constraints and lack of expertise. This is where academic writing

Read More »

Online Homework Help Services: A Complete Guide for Students

Introduction Homework is an essential part of a student’s learning process, helping reinforce classroom knowledge and improve understanding. However, with increasing academic pressure and multiple responsibilities, students often struggle to complete their homework on time. This is where online homework help services become highly beneficial. They provide expert guidance, save

Read More »

Thesis Writing Help: A Complete Guide for Students

Introduction A thesis is one of the most important academic documents a student will write during their educational journey. It requires in-depth research, critical analysis, and a clear presentation of ideas. However, many students find thesis writing overwhelming due to its complexity and time-consuming nature. This is where thesis writing

Read More »

Essay Writing Help: A Complete Guide for Students

Introduction Essay writing is a fundamental part of academic life, helping students express their ideas, analyze topics, and develop critical thinking skills. Whether it’s argumentative, descriptive, or analytical, writing a high-quality essay requires proper structure, research, and clarity. However, many students struggle with essay writing due to time constraints and

Read More »

Content Writing Assignment Help: A Complete Guide for Students

Introduction Content writing has become a crucial skill in the digital era, playing a key role in blogging, marketing, and online communication. From academic essays to website content, strong writing skills are essential for students across all fields. However, many students struggle with structuring content, maintaining clarity, and optimizing for

Read More »

Digital Marketing Assignment Help: A Complete Guide for Students

Introduction Digital marketing has become one of the most important skills in today’s online-driven world. From social media marketing to search engine optimization (SEO), businesses rely heavily on digital strategies to reach their audience. Students studying digital marketing often face challenges in understanding strategies, tools, and real-world applications. This is

Read More »

UI/UX Design Assignment Help: A Complete Guide for Students

Introduction UI/UX design is a crucial aspect of modern digital products, focusing on creating visually appealing and user-friendly interfaces. From websites to mobile apps, good design enhances user experience and engagement. Students studying UI/UX design often face challenges in creativity, tools, and usability principles. This is where UI/UX design assignment

Read More »

Can't Find Your Assignment?