<% foreach (var Lang in ((IEnumerable<Egovt.Models.Language>)ViewData["Languages"]))
{ %>
<div id="tabs-<%=Html.Encode(Lang.int_LangId) %>">
<% foreach (var OrganizationMeta in ((IEnumerable<Egovt.Models.OrganizationMeta>)ViewData["OrganizationMeta"]))
{ %>
<% if (OrganizationMeta.vcr_DateType == "text")
{ %>
<%=Server.HtmlDecode(OrganizationMeta.vcr_MetaValue)%><br /> <a href="#"></a>
<% } else if (OrganizationMeta.vcr_DateType == "file") { %>
<img alt="Image" src="../../Content/Logo/dd.gif" />
<% } %>
<% } %>
</div>
<% } %>
public ActionResult EditOrganizationMeta(int id)
{
var OrganizationMeta = OrganizationRepository.GetAllOrganizationMetaById(id).ToList();
ViewData["Languages"] = _db.Languages.ToList();
ViewData["OrganizationMeta"] = OrganizationMeta;
return View();
}
public IQueryable<OrganizationMeta> GetAllOrganizationMetaById(int OrganizationID)
{
return from gp in _db.OrganizationMetas
where gp.bit_IsDeletable == true && gp.int_OrganizationId==OrganizationID
orderby gp.int_OrganizationId ascending
select gp;
}
I want to base my second loop on the basis of first loop on the langid field, there are many ways but what you guys will use and which is the best approach. LangId is the pk and it is becoming fk in the oranaizationmeta.