All i want to do is to have the more bet info page show more betting options regarding to the eventid that been clicked from forstpage.
like
http://localhost:2344/morebettings?1233
show me all the more betinfo for this id just.
It seems that you are asking another question……,next time plz don't ask another question or you can create a new thread to ask:-)
Now I think you can use Request.QueryString to accept your groupID and then use
XmlDocument.SelectNodes("//group[@groupid='145535'")and then do binding。
I'm sorry but this was the question from the begining, but any way there are still problem, becasue it shows the first group id just, even if i clicked another id.
khayalian
Member
127 Points
143 Posts
open details.aspx by id in XML
Mar 18, 2012 10:06 AM|LINK
Hello
the page for game title information. There are many games and all game got eventid in xml.
<asp:DataList ID="DataList" runat="server"
<ItemTemplate>
<div><a href='Moreinfo.aspx?ProID=<%# XPath("event/@eventid") %>'>More </a></h3></div>
</ItemTemplate>
</asp:FormView>
This is the moreinfo.aspx page where it must show the more informations about the game depending on the id.
<asp:FormView ID="FormView_Moreinfo" runat="server" >
<ItemTemplate>
Event id:
<div><h3 id="1"><%# XPath("event/@eventid") %></h3></div>
</ItemTemplate>
</asp:FormView>
and the behind code is
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
LoadXmlData();
}
}
private void LoadXmlData()
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("Xml_Bet") + @"\Testing.xml");
XmlNodeList nodes = xmlDoc.SelectNodes("Koorabet/sport/group");
XmlElement elem = xmlDoc.GetElementById("event/@eventid");
FormView_Moreinfo.DataSource = elem;
FormView_Moreinfo.DataSource = nodes;
FormView_Moreinfo.DataBind();
}
when i click on more button i'm not getting the moreinfo.aspx page with the id, please help, im confused.
Thanks
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: open details.aspx by id in XML
Mar 20, 2012 01:58 AM|LINK
What's elem?Plz list it out so as to let us analyse……
khayalian
Member
127 Points
143 Posts
Re: open details.aspx by id in XML
Mar 20, 2012 07:23 PM|LINK
Hello Thank you for trying to helping me. this are all the codes please check it.
XMLFIle
///////////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="utf-8" ?>
<Koorabet last_modified="11/03/2012 22:48">
<sport name="Football" sportid="3893">
<group name="Spain - Copa del Rey" groupid="14555">
<event name="Athletic Bilbao v FC Barcelona" eventid="51329" closetime="25/05/2012 20:00">
<bettype name="Versus (with Draw)" eventid="14028878" etid="10">
<bet outcome_name="Athletic Bilbao" id="69923113" odd="8.00" status="Open"/>
<bet outcome_name="X" id="69923114" odd="4.50" status="Open"/>
<bet outcome_name="FC Barcelona" id="69923115" odd="1.35" status="Open"/>
</bettype>
<bettype name="Half Time" eventid="14028883" etid="120">
<bet outcome_name="1" id="69923126" odd="7.00" status="Open"/>
<bet outcome_name="X" id="69923127" odd="2.50" status="Open"/>
<bet outcome_name="2" id="69923128" odd="1.75" status="Open"/>
</bettype>
<bettype name="Double Chance" eventid="14028882" etid="140">
<bet outcome_name="1 or X" id="69923123" odd="2.88" status="Open"/>
<bet outcome_name="X or 2" id="69923124" odd="1.04" status="Open"/>
<bet outcome_name="1 or 2" id="69923125" odd="1.16" status="Open"/>
</bettype>
</event>
</group>
</sport>
</Koorabet>
//////////////////////////////////////////////////////////////////////////////////
This is the firstpage
//////////////////////////////////////////////////////////////////////////////////
<td class="leftcell minwidth">
<div>
<asp:Label ID="******" runat="server" Text=""></asp:Label>
<asp:DataList ID="DataList" runat="server"
Width="600px" >
<ItemTemplate>
<table width="100%" border="2" cellspacing="0" cellpadding="0">
<tr>
<td width="33%" style="font-family:Arial; font-size:small; color:Black" ><%# XPath("@name")%></td>
<td width="28%" style="font-family:Arial; font-size:small; color:Black"><%# XPath("event/@closetime")%></td>
<td width="14%" align="center"><asp:Label ID="Label1" runat="server" Text="1"></asp:Label>
</td>
<td width="14%" align="center" ><asp:Label ID="Label2" runat="server" Text="X"></asp:Label></td>
<td width="14%" align="center"><asp:Label ID="Label3" runat="server" Text="2"></asp:Label></td>
<td width="15%" align="center"><img src="Images/cfp.gif" /></td>
</tr>
</table>
<table width="100%" border="2" cellspacing="0" cellpadding="0">
<tr>
<td width="33%" style="font-family:Arial; font-size:small; color:Red"><%# XPath("event/@name")%></td>
<td width="28%" style="font-family:Arial; font-size:small; color:Red"></td>
<td onMouseOver="this.bgColor='#FFCC00'" onMouseOut="this.bgColor=''" width="14%" align="center" style="font-family:Arial; font-size:small; color:Red">
<%# XPath("event/bettype/bet[1]/@odd")%>
</td>
<td onMouseOver="this.bgColor='#FFCC00'" onMouseOut="this.bgColor=''" width="14%" align="center" style="font-family:Arial; font-size:small; color:Red">
<%# XPath("event/bettype/bet[2]/@odd")%>
</td>
<td onMouseOver="this.bgColor='#FFCC00'" onMouseOut="this.bgColor=''" width="14%" align="center" style="font-family:Arial; font-size:small; color:Red">
<%# XPath("event/bettype/bet[3]/@odd")%></td>
<td width="15%" align="center" ><a href='MoreBetting.aspx?eventID=<%# XPath("event/@eventid") %>'>More </a>
<br />
</td>
</tr>
</tr>
</table><br />
</ItemTemplate>
</asp:DataList>
</div>
///////////////////////////////////////////////////////////////////////////////////
And this is the more bet info page
///////////////////////////////////////////////////////////////////////////////////
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<asp:DataList ID="DataList1" runat="server"
Width="600px" >
<ItemTemplate>
<table>
<tr>
<td>
<%# XPathSelect("@eventid") %> <br />
<asp:Label ID="Label1" runat="server" ForeColor="Red"><%# XPath("@eventid") %> </asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
///////////////////////////////////////////////////////////////////////////////////
All i want to do is to have the more bet info page show more betting options regarding to the eventid that been clicked from forstpage.
like
http://localhost:2344/morebettings?1233
show me all the more betinfo for this id just.
Thank you waiting for replay.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: open details.aspx by id in XML
Mar 21, 2012 01:17 AM|LINK
Hello again:)
I've tried your codes and I found that because you've bound to a wrong tags,and you should directly bind to group instead of element/@name,see mine:
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(Request.MapPath("XMLFile1.xml")); XmlNodeList nodes = xmlDoc.SelectNodes("Koorabet/sport/group"); rep.DataSource = nodes; rep.DataBind();khayalian
Member
127 Points
143 Posts
Re: open details.aspx by id in XML
Mar 21, 2012 06:01 AM|LINK
Hello again
please could you give me the code youmade just to understand you more well.
Thank you
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: open details.aspx by id in XML
Mar 21, 2012 06:24 AM|LINK
Hello:)
I've just offered the codes above,which has pointed the most important part——The correct one is that you should use this:
XmlNodeList nodes = xmlDoc.SelectNodes("Koorabet/sport/group");Not this:XmlElement elem = xmlDoc.GetElementById("event/@eventid"); //Wrong!khayalian
Member
127 Points
143 Posts
Re: open details.aspx by id in XML
Mar 21, 2012 06:00 PM|LINK
Hello
I tried it but still having all resualts shown.
Have a look to this xml please
//////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="utf-8" ?>
<Koorabet last_modified="11/03/2012 22:48">
<sport name="Football" sportid="3893">
<group name="Spain - Copa del Rey" groupid="14555">
<event name="Athletic Bilbao v FC Barcelona" eventid="51329" closetime="25/05/2012 20:00">
<bettype name="Versus (with Draw)" eventid="14028878" etid="10">
<bet outcome_name="Athletic Bilbao" id="69923113" odd="8.00" status="Open"/>
<bet outcome_name="X" id="69923114" odd="4.50" status="Open"/>
<bet outcome_name="FC Barcelona" id="69923115" odd="1.35" status="Open"/>
</bettype>
<bettype name="Half Time" eventid="14028883" etid="120">
<bet outcome_name="1" id="69923126" odd="7.00" status="Open"/>
<bet outcome_name="X" id="69923127" odd="2.50" status="Open"/>
<bet outcome_name="2" id="69923128" odd="1.75" status="Open"/>
</bettype>
<bettype name="Double Chance" eventid="14028882" etid="140">
<bet outcome_name="1 or X" id="69923123" odd="2.88" status="Open"/>
<bet outcome_name="X or 2" id="69923124" odd="1.04" status="Open"/>
<bet outcome_name="1 or 2" id="69923125" odd="1.16" status="Open"/>
</bettype>
</event>
</group>
<group name="Spain - Copa del Rey" groupid="145535">
<event name="Athletic Bilbao v FC Barcelona" eventid="1233" closetime="25/05/2012 20:00">
<bettype name="Versus (with Draw)" eventid="140282878" etid="10">
<bet outcome_name="Athletic Bilbao" id="6992343113" odd="18.00" status="Open"/>
<bet outcome_name="X" id="6992223114" odd="4.50" status="Open"/>
<bet outcome_name="FC Barcelona" id="69923332115" odd="1.35" status="Open"/>
</bettype>
<bettype name="Half Time" eventid="4" etid="120">
<bet outcome_name="1" id="69924223126" odd="7.00" status="Open"/>
<bet outcome_name="X" id="69922223127" odd="2.50" status="Open"/>
<bet outcome_name="2" id="69924233128" odd="1.75" status="Open"/>
</bettype>
<bettype name="Double Chance" eventid="142424028882" etid="140">
<bet outcome_name="1 or X" id="699232323123" odd="2.88" status="Open"/>
<bet outcome_name="X or 2" id="69924223124" odd="1.04" status="Open"/>
<bet outcome_name="1 or 2" id="6992423125" odd="1.16" status="Open"/>
</bettype>
</event>
</group>
</sport>
</Koorabet>
/////////////////////////////////////////////////////////////////////////////////////////////
I have diffrant groupid's and when click on more link alone having betinfo.aspx all the infos.
http://localhost:38042/newKoora/BetList.aspx?groupID=14555
http://localhost:38042/newKoora/BetList.aspx?groupID=145535
i need when some one clicks on
http://localhost:38042/newKoora/BetList.aspx?groupID=145535
have the information only for this groupid or eventid.
Thanks you so much but still waiting for replay.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: open details.aspx by id in XML
Mar 22, 2012 01:15 AM|LINK
Hello again:)
It seems that you are asking another question……,next time plz don't ask another question or you can create a new thread to ask:-)
Now I think you can use Request.QueryString to accept your groupID and then use XmlDocument.SelectNodes("//group[@groupid='145535'") and then do binding。
khayalian
Member
127 Points
143 Posts
Re: open details.aspx by id in XML
Mar 22, 2012 07:37 PM|LINK
Hello again
I'm sorry but this was the question from the begining, but any way there are still problem, becasue it shows the first group id just, even if i clicked another id.
Thanks
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: open details.aspx by id in XML
Mar 23, 2012 01:26 AM|LINK
When you click another id,plz check what's your URL?It should be changed and your page is refreshed……