Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 客户端带有XmlDataSource的Realod数据列表_Javascript_Jquery_Asp.net - Fatal编程技术网

Javascript 客户端带有XmlDataSource的Realod数据列表

Javascript 客户端带有XmlDataSource的Realod数据列表,javascript,jquery,asp.net,Javascript,Jquery,Asp.net,您好,我想使用jquery或javscript在固定时间间隔后重新加载客户端上的数据列表,以便获得最新的RSS新闻提要。这是我的代码 <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://www.example.com/category/test/feed/" XPath="rss/channel/item"></asp:XmlDataSource> <asp:DataLi

您好,我想使用jquery或javscript在固定时间间隔后重新加载客户端上的数据列表,以便获得最新的RSS新闻提要。这是我的代码

<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://www.example.com/category/test/feed/"
   XPath="rss/channel/item"></asp:XmlDataSource>
<asp:DataList ID="dlRss" runat="server" DataSourceID="XmlDataSource1">
   <ItemTemplate>
      <label style="color: #222222; float: left; font-size: 16px; margin-top: 5px; width: 190px;">
      <%#  XPath("title")%></label>
      <label style="color: #444444; display: inline-block; font-size: 11px; margin-bottom: 5px;
         width: 190px;">
      <%# Convert.ToDateTime(XPath("pubDate")).ToShortDateString() + " @" + Convert.ToDateTime(XPath("pubDate")).ToShortTimeString()%></label>
      <label style="color: #444444; display: inline-block; font-size: 13px; width: 190px;">
      <%#XPath("description").ToString().Length <= 200 ? XPath("description") : XPath("description").ToString().Substring(0,200) + "...<a href='" + XPath("link").ToString() + "' target='_blank'>more</a>"%></label>
      <br />
   </ItemTemplate>
</asp:DataList>
“%>


您不能在客户端设置
数据源。
但您可以做的是在特定间隔后重新加载页面。
否则您必须将http处理程序与jtemplate和jquery一起使用

以下是一些可能对您有所帮助的链接


谢谢,我想我应该使用Json和WEDMethods来绑定数据列表,因为页面很重,我不想重新加载整个页面