Apr 27, 2011, 12:53 PM
I want dataview in vb but I cant do it in vb.net please help me
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
XElement document = XElement.Load(Server.MapPath("resources/DashboardSchema.xml"));
var defaultIcon = document.Attribute("defaultIcon") != null ? document.Attribute("defaultIcon").Value : "";
var query = from g in document.Elements("group")
select new
{
Title = g.Attribute("title") != null ? g.Attribute("title").Value : "",
Items = (from i in g.Elements("item")
select new
{
Title = i.Element("title") != null ? i.Element("title").Value : "",
Icon = i.Element("item-icon") != null ? i.Element("item-icon").Value : defaultIcon,
Id = i.Element("id") != null ? i.Element("id").Value : ""
}
)
};
this.Store1.DataSource = query;
this.Store1.DataBind();
}
}
{
if (!X.IsAjaxRequest)
{
XElement document = XElement.Load(Server.MapPath("resources/DashboardSchema.xml"));
var defaultIcon = document.Attribute("defaultIcon") != null ? document.Attribute("defaultIcon").Value : "";
var query = from g in document.Elements("group")
select new
{
Title = g.Attribute("title") != null ? g.Attribute("title").Value : "",
Items = (from i in g.Elements("item")
select new
{
Title = i.Element("title") != null ? i.Element("title").Value : "",
Icon = i.Element("item-icon") != null ? i.Element("item-icon").Value : defaultIcon,
Id = i.Element("id") != null ? i.Element("id").Value : ""
}
)
};
this.Store1.DataSource = query;
this.Store1.DataBind();
}
}