System. usecodepage = true;
_ Global. arrtitle = new array (5 );
_ Global. arrimage = new array (5 );
_ Global. arrurl = new array (5 );
Function loadxml ()
{
Myxml = New XML ();
Myxml. ignorewhite = true;
Myxml. Load ("http: // 192.168.0.244/8mchina2/flash/tvindex. aspx ");
Myxml. onload = function (SUCCESS)
{
If (SUCCESS)
{
Len = myxml. firstchild. childnodes. length;
For (I = 0; I <5; I ++)
{
_ Global. arrtitle [I] = myxml. firstchild. childnodes [I]. Attributes. title;
_ Global. arrimage [I] = myxml. firstchild. childnodes [I]. Attributes. image;
_ Global. arrurl [I] = myxml. firstchild. childnodes [I]. Attributes. url;
Eval ("_root.txt" + (I + 1). Text = _ global. arrtitle [I];
}
}
Else
{
Loadxml ();
}
};
}
Loadxml ();
Aspx File Processing:
<% @ Import namespace = "bmhd. components. Components" %>
<% @ Import namespace = "bmhd. Components" %>
<% @ Page Language = "C #" codebehind = "tvindex. aspx. cs" autoeventwireup = "false" inherits = "bmhd. Web. xml. tvindex" %> <? XML version = "1.0" encoding = "gb2312"?>
<XML>
<Asp: repeater id = "repeater1" runat = "server">
<Itemtemplate>
<Item id = "<% # databinder. eval (container. dataitem, "ID") %> "Title =" <% # databinder. eval (container. dataitem, "title") %> "url =" <% # databinder. eval (container. dataitem, "Link") %> "image =" <% # topicture. getpictureurl (databinder. eval (container. dataitem, "imageurl "). tostring () %> "/>
</Itemtemplate>
</ASP: repeater>
</XML>
Background code:
Private void page_load (Object sender, system. eventargs E)
{
// Place user code here to initialize the page
//
Response. contenttype = "text/XML ";
Repeater1.datasource = topics. gettop5tvindex (). topics;
Repeater1.databind ();
}