A
André Freitas
XDocument xDocument = XDocument.Load(MapPath("Breadcrumb.xml"));
var linq =
from breads in xDocument.Root.Elements("bread")
where breads.Attribute("script").Value == "/SomeScript.aspx"
select new
{
description =
(string)breads.Element("link").Attribute("description"),
url = (string)breads.Element("link").Attribute("url")
};
foreach (var linqRow in linq)
{
Response.Write("<script>alert('" + linqRow.description +
"')</script>");
}
<breadcrumb>
<bread script="/SomeScript.aspx">
<link description="some descriptiuon for acutal page"/>
<link description="Home" url="Default.aspx"/>
</bread>
...
</breadcrumb>
Its returning me only the first "link", not all the links inside bread.
Can someone point me how to solve it?
All the best,
André
var linq =
from breads in xDocument.Root.Elements("bread")
where breads.Attribute("script").Value == "/SomeScript.aspx"
select new
{
description =
(string)breads.Element("link").Attribute("description"),
url = (string)breads.Element("link").Attribute("url")
};
foreach (var linqRow in linq)
{
Response.Write("<script>alert('" + linqRow.description +
"')</script>");
}
<breadcrumb>
<bread script="/SomeScript.aspx">
<link description="some descriptiuon for acutal page"/>
<link description="Home" url="Default.aspx"/>
</bread>
...
</breadcrumb>
Its returning me only the first "link", not all the links inside bread.
Can someone point me how to solve it?
All the best,
André