0

In MVC 4 application I have Nuget Umbraco CMS 7.

I need to keep a non-Umbraco/ custom controller with view. I have created an MVC controller named Users which has an action named Index. I have updated umbracoReservedUrls in web.config as below:

<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,~/Users/Index" />

Below is my controller code:

 public class UsersController : Controller
    {
        //
        // GET: /Users/

        public ActionResult Index(User model)
        {
            return View(model);
        }

    }

My view markup is as below:

@model Common.Model.User

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

Issue: On running if I navigate to http://localhost:56512/users/index, control do not come to controller and in browser I got 404 error as detailed below:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Can you please guide how to fix this and navigate to non Umbraco views and controllers ?

user576510
  • 5,777
  • 20
  • 81
  • 144

1 Answers1

-1

Put the controllerpath in umbracoReservedPaths instead of UmbracoReservedUrls.

Or consider to wrap your controller in a RenderMvcController, surface controller, partial view, ...

dampee
  • 3,392
  • 1
  • 21
  • 37
  • Thanks @dampee, my controller 'UsersController' is in default controlelrs folder and view 'Index' is in view/Users/Index. Can you please guide how I should configure it ? Is it same as I mentioned above ? – user576510 Sep 15 '14 at 17:29
  • my controller is located in default controllers folder. I did but it did not work. – user576510 Sep 15 '14 at 23:12
  • Are you sure your controller is compiled? If you are using a website (in webmatrix e.g.), it's easier to move it to App_Code. – dampee Sep 16 '14 at 07:56