Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:43:37+00:00 2026-06-09T21:43:37+00:00

The error I get is: The type or namespace name ‘LastSundayDate’ could not be

  • 0

The error I get is:

The type or namespace name ‘LastSundayDate’ could not be found (are you missing a using directive or an assembly reference?)

Here is my view code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Report/Report.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<LastSundayDate>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   Trade Searches Data
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>TradeUK KPI Searches Data</h2>
<p></p>

Then I have:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TradeUK.Entities.Reporting
 {
   public class LastSundayDate
   {
       public virtual int Title { get; set; }
       public virtual int Total { get; set; }
       public virtual int Week6 { get; set; }
       public virtual int Week5 { get; set; }
        public virtual int Week4 { get; set; }
        public virtual int Week3 { get; set; }
       public virtual int Week2 { get; set; }
        public virtual int Week1 { get; set; }
   }
 }

In my controller I have:

public ActionResult TradeUKKPIShowData(DateTime date) //show actual data in the view
{
  var reportData = _reportingService.GetTradeUKKPISearches(date);
  return View(reportData);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:43:39+00:00Added an answer on June 9, 2026 at 9:43 pm

    Include the Namespace of your class. Otherwise your program can not understand where is this LastSundayDate class is present in.

    Change

    Inherits="System.Web.Mvc.ViewPage<IEnumerable<LastSundayDate>>
    

    to

    Inherits="System.Web.Mvc.ViewPage<IEnumerable<
                                         TradeUK.Entities.Reporting.LastSundayDate>>
    

    Alternatively, You can also Import the namespace to the View.Add this line in your view, above the Page directive declaration

    <%@ Import Namespace="TradeUK.Entities.Reporting" %>
    

    Now you do not need to Add the full namespce for the class, You can simply access the class in your view. The code in your question would work fine.

    If this class is defined in a Project other than your current UI project, you need to add a reference to that project under the References section

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The type or namespace name 'Question'could not be found (are you missing a using
Helllo, I get this error: CS0246: The type or namespace name 'DataClasses1DataContext' could not
I get this error message in Eclipse: Access restriction: The type DirectoryWalker is not
I have using System.Management; However, I keep getting this error: The type or namespace
In one page of my application I get Type is undefined error on the
I get an incomplete type error when trying to compile my code. I know
I get this error about casting from type A to type B because the
I get a Data type mismatch criteria expression error when i try to retrieve
Why do I get this error OpenTypeSelectionDialog cannot be resolved to a type when
Why do I get the error: Unable to create a constant value of type

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.