You could use child actions along with the Html.Action and Html.RenderAction helpers. So let's elaborate with an example.
As always you start with a view model that will represent the information you want to show on this particular view (or in this case partial view):
public class InboxViewModel
{
public int NumberOfUnreadMails { get; set; }
}
then a controller:
public class InboxController : Controller
{
public ActionResult Index()
{
InboxViewModel model = ... // Repository, DI into the controller, ...
return View(model);
}
}
then a corresponding view (~/Views/Inbox/Index.ascx
):
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%: Html.ActionLink("Inbox - " + Model.NumberOfUnreadMails, "Index", "Home") %>
and finally embed this in your master page so that it is available on all views:
<div class="leftMenu">
<% Html.RenderAction("Index", "Inbox"); %>
</div>