Personally, I think that this will really be a way to “hack” for implementation and support in the long run.
Why don't you just use URL parameters?
Example. A specific implementation would be something like this:
public ActionResult BackGroundColorChangerAction(string color = "") {
ViewData["backgroundColor"] = color;
return View();
}
. ViewData :
...
<body>
<div>
<h2>Your Current Color: <b><%: ViewData["backgroundColor"] %></b></h2>
<%: Html.ActionLink("Red", "BackGroundColorChangerAction", new { color = "red" }) %><br />
<%: Html.ActionLink("Green", "BackGroundColorChangerAction", new { color = "green" }) %><br />
<%: Html.ActionLink("Blue", "BackGroundColorChangerAction", new { color = "blue" }) %><br />
</div>
</body>
...
ViewData [ "backgroundColor" ].
JavaScript, html.
, Enum , .