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

  • Home
  • SEARCH
  • 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 631659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:59:24+00:00 2026-05-13T19:59:24+00:00

I’m new to ASP.NET MVC and I’m creating an app that will search a

  • 0

I’m new to ASP.NET MVC and I’m creating an app that will search a contact using using the autocomplete functionality along with jquery.

When I run the project it loads fine and when i click the submit button to search a lastname i receive an error.

Server Error in ‘/’ Application.
The resource cannot be found

Requested URL:/Offender/Search

While attempting this project i followed along witht Northwind MVC Sample and that project also gave me errors as well.

Any help is appreciated! Thanks

The errors i receive are as follows:

Error 1

The type or namespace name ‘KOOLSModel’ could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\My Documents\Visual Studio 2008\Projects\DOC_KOOLS\DOC_KOOLS\Controllers\OffenderController.cs 6 7 DOC_KOOLS

Error 2

The type or namespace name ‘KOOLSEntities’ could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\My Documents\Visual Studio 2008\Projects\DOC_KOOLS\DOC_KOOLS\Controllers\OffenderController.cs 15 32 DOC_KOOLS

Error 3

The type or namespace name ‘Offender’ could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\My Documents\Visual Studio 2008\Projects\DOC_KOOLS\DOC_KOOLS\Controllers\OffenderController.cs 32 22 DOC_KOOLS

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

using KOOLSModel;

namespace DOC_KOOLS.Controllers
{
    public class OffenderController : Controller
    {
        //
        // GET: /Offender/
        //KOOLSEntities KOOLS = new KOOLSEntities();
        KOOLSEntities db = new KOOLSEntities();

        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to KOOL!";
            return View();
        }

        public ActionResult getAjaxResult(string q)
        {
            string searchResult = string.Empty;

            var offender = (from o in db.Offender
                            where o.Lastname.Contains(q)
                            orderby o.LastName
                            select o).Take(10);

            foreach (Offender o in offender)
            {
                searchResult += string.Format("{0}|\r\n", o.LastName);
            }
            return Content(searchResult);
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Search(string searchTerm)
        {
            if (searchTerm == string.Empty)
            {
                return View();
            }
            else
            {
                //  if the search contains only one result retunr details
                // otherwise a list
                var offenders = from o in db.Offender
                                where o.LastName.Contains(searchTerm)
                                orderby o.LastName
                                select o;
                if (offenders.Count() == 0)
                {
                    return View("notfound");
                }

                if (offenders.Count > 1)
                {
                    return View("List", offenders);
                }
                else
                {
                    return RedirectToAction("Details", new { id = offenders.First().sPN });
                }
            }
        }
        public ActionResult About()
        {
            return View();
        }
    }
}
  • 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-05-13T19:59:25+00:00Added an answer on May 13, 2026 at 7:59 pm

    It looks like you didn’t add a reference to the assembly containing the entity model.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need a function that will clean a strings' special characters. I do NOT
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.

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.