Having some problems with strongly typed views in ASP.Net MVC...
Master Page:
<div id="footer-container">
<div id="actual-footer">
<% Html.RenderAction("GetFooter", "Footer"); %>
</div>
</div>
This I think should call the GetFooter action on the FooterController class?
Model (/models/PageFooter.cs):
namespace Web.Models
{
public class PageFooter
{
public PageFooter()
{
Title = DateTime.Now.ToString();
}
public string Title { get; set; }
}
}
That's my model which simply on construction populates the Title with datetime.now.
Controller (/Controlers/FooterController.cs):
namespace Web.Controllers
{
public class FooterController : Controller
{
public ActionResult GetFooter()
{
return View(new Web.Models.PageFooter());
}
}
}
And now the actual view itself...
View (/Views/Footer/Footer.aspx):
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Web.Models.PageFooter>" %>
<% Html.Label(Model.Title); %>
The problem is it just does not recognise Model.Title which I believe is the conversion.
Any ideas?