danielolorenz
asked on
I Added a New Page and Controller on MVC and Get an Internal Server Error?
I am building a new MVC Application. I added a new page and a new controller. When I go to the new page, I get the following error: The page cannot be displayed because an internal server error has occurred.
Do you know how to fix this error?
Thanks,
Dan
Do you know how to fix this error?
Thanks,
Dan
ASKER
Yes, I am hitting the controller. I set a break point in the controller and it is hitting the ActionResult Index().
I wrote a basic Controller and a Basic view with the view returning to the controller.
I Wrote a basic Controller:
View:
I wrote a basic Controller and a Basic view with the view returning to the controller.
I Wrote a basic Controller:
using System.Web.Configuration;
using System.Web.Mvc;
namespace BCA.GunPermit.Controllers
{
public class GunPermitSearchController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
View:
@{
ViewBag.Title = "Search";
}
<h2>Search Test</h2>
<br />
<div class="gun-permit-search">
<div id="search-purpose-code" class="well well-sm">
</div>
</div>
What is your view called? Is it called "Search", or is it called "Index"?
ASKER
It is called Search
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A bit more detail about your controller, view and what both are doing would be helpful.