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 7823243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:10:43+00:00 2026-06-02T08:10:43+00:00

I am working at an ASp.net mvc 3 project and I keep getting this

  • 0

I am working at an ASp.net mvc 3 project and
I keep getting this error and can find any help to solve the problem

Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) 
could have been removed, had its name changed, or is temporarily unavailable.      Please       review  the following URL and make sure that it is spelled correctly.

  Requested URL: /RoomType

But I have The RoomType controller and in my Global.asax I have:

     public static void RegisterRoutes(RouteCollection routes)
      {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.MapRoute(
     null, // we don't need to specify a name
     "Page{page}",
           new { Controller = "Room", action = "List" }

);

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Room", action = "List", id = UrlParameter.Optional } // Parameter defaults
        );

        routes.MapRoute(
            null, // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Room", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );
        routes.MapRoute(
           null, // Route name
           "{controller}/{action}/{id}", // URL with parameters
           new { controller = "RoomType", action = "Index", id = UrlParameter.Optional } // Parameter defaults
       );

Here is my RoomTypeController :

   using System;
   using System.Collections.Generic;
   using System.Data;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
     using System.Data.Objects;
       using System.Linq;
     using System.Web;
     using System.Web.Mvc;
     using MvcApplication4.Models;

     namespace MvcApplication4.Controllers
    {
    public class RoomTypeController : Controller
    {
    private hotelEntities db = new hotelEntities();

    //
    // GET: /RoomType/

    public ViewResult Index(int start = 0, int itemsPerPage = 20, string orderBy = "RoomType_ID", bool desc = false)
    {
        ViewBag.Count = db.Room_Type.Count();
        ViewBag.Start = start;
        ViewBag.ItemsPerPage = itemsPerPage;
        ViewBag.OrderBy = orderBy;
        ViewBag.Desc = desc;

        return View();
    }

    //
      // GET: /RoomType/GridData/?start=0&itemsPerPage=20&orderBy=RoomType_ID&desc=true

        public ActionResult GridData(int start = 0, int itemsPerPage = 20, string orderBy = "RoomType_ID", bool desc = false)
        {
        Response.AppendHeader("X-Total-Row-Count", db.Room_Type.Count().ToString());
         ObjectQuery<Room_Type> room_type = (db as   IObjectContextAdapter).ObjectContext.CreateObjectSet<Room_Type>();
        room_type = room_type.OrderBy("it." + orderBy + (desc ? " desc" : ""));

        return PartialView(room_type.Skip(start).Take(itemsPerPage));
    }

    //
    // GET: /Default5/RowData/5

    public ActionResult RowData(int id)
    {
        Room_Type room_type = db.Room_Type.Find(id);
        return PartialView("GridData", new Room_Type[] { room_type });
    }

    //
    // GET: /RoomType/Create

    public ActionResult Create()
    {
        return PartialView("Edit");
    }

    //
    // POST: /RoomType/Create

    [HttpPost]
    public ActionResult Create(Room_Type room_type)
    {
        if (ModelState.IsValid)
        {
            db.Room_Type.Add(room_type);
            db.SaveChanges();
            return PartialView("GridData", new Room_Type[] { room_type });
        }

        return PartialView("Edit", room_type);
    }

    //
    // GET: /RoomType/Edit/5

    public ActionResult Edit(int id)
    {
        Room_Type room_type = db.Room_Type.Find(id);
        return PartialView(room_type);
    }

    //
    // POST: /RoomType/Edit/5

    [HttpPost]
    public ActionResult Edit(Room_Type room_type)
    {
        if (ModelState.IsValid)
        {
            db.Entry(room_type).State = EntityState.Modified;
            db.SaveChanges();
            return PartialView("GridData", new Room_Type[] { room_type });
        }

        return PartialView(room_type);
    }

    //
    // POST: /RoomType/Delete/5

    [HttpPost]
    public void Delete(int id)
    {
        Room_Type room_type = db.Room_Type.Find(id);
        db.Room_Type.Remove(room_type);
        db.SaveChanges();
    }

    protected override void Dispose(bool disposing)
    {
        db.Dispose();
        base.Dispose(disposing);
     }
   }
  }
  • 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-02T08:10:45+00:00Added an answer on June 2, 2026 at 8:10 am

    Make sure that your controller class is called RoomTypeController (and not RoomType, and not RoomController) and that it contains an Index action:

    public class RoomTypeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an ASP.Net MVC 3 project, which needs localized error messages from
I am working on an asp.net MVC 3 project as a team member. This
background:Me and my coworkers are working on asp.net mvc project ... we have a
I working on my first ASP.net MVC project and and i got some problems
I'm working in an ASP.NET MVC Beta 1 project, and I've noticed that if
I've integrated ASP.NET MVC 3 project into existing Web Forms project. It was working
I'm working on an ASP.NET MVC 2 / .NET 3.5 project which includes SSRS
While working in ASP.NET MVC, I often find myself defining a basic ViewModel which
I'm working in an ASP.NET MVC project where I have created a two LinqToSQL
I'm working on an asp.net-mvc project. I have an Items table and a Tags

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.