I am new on MVC, and I am Getting following error while rendering partial view with controller.
Execution of the child request failed. Please examine the InnerException for more information.
and in innerException showing this:
T
he controller for path '/' was not found or does not implement IController.
Please help me guys......
Here is my
DataContract Class
namespace DataContracts
{
public class StoryWidget
{
public string SportName { get; set; }
public string imageURL { get; set; }
public string SportTitle { get; set; }
public string SeriesTitle { get; set; }
public string AuthorName { get; set; }
}
}
Here is my Controller
Controller
public class StoryController : Controller
{
[ChildActionOnly]
public ActionResult _StoryWidgetPartial(string SName)
{
var model = new List<StoryWidget>();
if (model != null)
{
StoryWidget item = new StoryWidget() { SportName = SName, SeriesTitle = "IPL 2013", SportTitle = "ICC Hall" };
model.Add(item);
};
return View(model);
}
}
Here is my
Partial View :
@model DataContracts.StoryWidget
<div class="nw-img">
@*@foreach (var item in Model)
{*@
<div class="col-6">
<a href="#" title="@Model.SportTitle">
<img src="images/football_1.jpg" alt="Waqar, Gilchrist indeucted into ICC Hall of Fame"
title="Waqar, Gilchrist indeucted into ICC Hall of Fame" /></a>
</div>
@*}*@
</div>
And I am Calling this partial from my
_Layout.cshtml :
@{Html.RenderAction("_StoryWidgetPartial", "StoryController", "Cricket");}
I am Getting this
exception at this above Line("
@{Html.RenderAction("
)
Execution of the child request failed. Please examine the InnerException for more information.
and in innerException showing this:
The controller for path '/' was not found or does not implement IController.
Please help me guys......