What I need is to display Area_Name in various links within my view. Rather than repeat the same loop below each time, can I assign Area_Name to a variable and then display that variable in each link within my view?
ViewData
filterContext.Controller.ViewData["Categories"] = from m in _dataContext.Categories where m.Area_ID == SectionID select m;
View Page
Stylesheet
<%
foreach (var c in (IEnumerable<Categories>)ViewData["Categories"]) { %>
<link href="../../Content/<%= c.Area_Name %>/Site.css" rel="stylesheet" type="text/css" />
<% } %>
Image
<%
foreach (var c in (IEnumerable<Categories>)ViewData["Categories"]) { %>
<img src="../../Content/images/<%= c.Area_Name %>/slide1.jpg" />
<img src="../../Content/images/<%= c.Area_Name %>/slide2.jpg" />
<img src="../../Content/images/<%= c.Area_Name %>/slide3.jpg" />
<% } %>