I have a link like this:
<a href='Member/MemberHome/Profile/Id'><span>Profile</span></a>
and when I click on this it will call this partial page:
@{
switch ((string)ViewBag.Details)
{
case "Profile":
{
@Html.Partial("_Profile"); break;
}
}
}
Partial page _Profile contains:
Html.Action("Action", "Controller", model.Paramter)
Example:
@Html.Action("MemberProfile", "Member", new { id=1 }) // id is always changing
My doubt is that how can I pass this "Id" to model.parameter part?
My controllers are:
public ActionResult MemberHome(string id)
{
ViewBag.Details = id;
return View();
}
public ActionResult MemberProfile(int id = 0)
{
MemberData md = new Member().GetMemberProfile(id);
return PartialView("_ProfilePage",md);
}