Server Error in '/' Application.

Mar 14, 2012 at 4:51 AM

Hi

I have just started ths tutorial i have created the controller home_controller and changed it to see below however when i run it as the tutorial says it gives me a 404 error can someone help

Thanks

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace music_store.Controllers
{
    public class home_controller : Controller
    {
        //
        // GET: /home_controller/

        public string Index()
        {
            return "home";
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcMusicStore.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}
}
}
Coordinator
Mar 14, 2012 at 6:01 PM
ASP.NET MVC uses some naming conventions, so you'll need to follow the tutorial more closely if you expect it to work. :-)
The tutorial has you name the controller HomeController, not home_controller (http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-2). If your controller is named /home_controller/ you'll need to browse to the URL shown in the comments above the method: /home_controller/
I'd recommend following along with things exactly until you get the hang of it, then branch out and use your own naming conventions where you'd like.
- Jon
On Tue, Mar 13, 2012 at 9:51 PM, tornad0 <notifications@codeplex.com> wrote:

From: tornad0

Hi

I have just started ths tutorial i have created the controller home_controller and changed it to see below however when i run it as the tutorial says it gives me a 404 error can someone help

Thanks

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace music_store.Controllers
{
public class home_controller : Controller
{
//
// GET: /home_controller/

public string Index()
{
return "home";
}

}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcMusicStore.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}
}
}

Read the full discussion online.

To add a post to this discussion, reply to this email (mvcmusicstore@discussions.codeplex.com)

To start a new discussion for this project, email mvcmusicstore@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com