Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 28, 2012 01:42 AM by Decker Dong - MSFT
Member
127 Points
143 Posts
Mar 26, 2012 09:48 PM|LINK
Hello i have this xml ///////////////////////////////////////////////////////////////////////////////
<bettype name="Versus (with Draw)" eventid="13986376" etid="10"> <bet outcome_name="Atletico Rafaela" id="69702140" odd="2.00" status="Open"/> <bet outcome_name="X" id="69702141" odd="3.10" status="Open"/> <bet outcome_name="Union de Santa Fe" id="69702142" odd="3.75" status="Open"/>
///////////////////////////////////////////////////////////////////////////////
in this XML i have status="open"
i want to make the datalist that shows this infos when the status are in open and make it unvisible or unclickable if the status Close.
How can i do that help please
Thank you
All-Star
118619 Points
18779 Posts
Mar 28, 2012 01:42 AM|LINK
Hello:)
1)Read out all of your bet tags by using LINQ-TO-XML:
var result = from e in XDocument.Load("xxx.xml").Descedants("bet") select new { …………………… Status = e.Attribute("status").Value };
2)Do binding by setting Enabled or Visible property:
<asp:…… Enabled/Visible='<%#Eval("Status").ToString().Equals("Open")%>'/></asp:……>
khayalian
Member
127 Points
143 Posts
Xml check status
Mar 26, 2012 09:48 PM|LINK
Hello i have this xml
///////////////////////////////////////////////////////////////////////////////
<bettype name="Versus (with Draw)" eventid="13986376" etid="10">
<bet outcome_name="Atletico Rafaela" id="69702140" odd="2.00" status="Open"/>
<bet outcome_name="X" id="69702141" odd="3.10" status="Open"/>
<bet outcome_name="Union de Santa Fe" id="69702142" odd="3.75" status="Open"/>
///////////////////////////////////////////////////////////////////////////////
in this XML i have status="open"
i want to make the datalist that shows this infos when the status are in open and make it unvisible or unclickable if the status Close.
How can i do that help please
Thank you
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Xml check status
Mar 28, 2012 01:42 AM|LINK
Hello:)
1)Read out all of your bet tags by using LINQ-TO-XML:
var result = from e in XDocument.Load("xxx.xml").Descedants("bet") select new { …………………… Status = e.Attribute("status").Value };2)Do binding by setting Enabled or Visible property:
<asp:…… Enabled/Visible='<%#Eval("Status").ToString().Equals("Open")%>'/></asp:……>