当前位置:编程学习 > C#/ASP.NET >>

请问通过ajaxpro怎么绑定到datalist上?

我想实现下面功能.用ajaxpro

当鼠标移动到菜单时,下面的datalist通过ajaxpro取得的数据显示相应的数据,请问怎么实现?谢谢. --------------------编程问答-------------------- ajaxpro可以返回dataset的吧.呵呵.
http://www.cnblogs.com/xiangpiren/archive/2007/08/26/869920.html
http://www.cnblogs.com/xiangpiren/archive/2007/08/26/869920.html --------------------编程问答-------------------- 返回dataset~ --------------------编程问答--------------------
引用 1 楼 lonely7345 的回复:
ajaxpro可以返回dataset的吧.呵呵. 
http://www.cnblogs.com/xiangpiren/archive/2007/08/26/869920.html 
http://www.cnblogs.com/xiangpiren/archive/2007/08/26/869920.html


同意 --------------------编程问答--------------------
引用 1 楼 lonely7345 的回复:
ajaxpro可以返回dataset的吧.呵呵. 
http://www.cnblogs.com/xiangpiren/archive/2007/08/26/869920.html 
http://www.cnblogs.com/xiangpiren/archive/2007/08/26/869920.html

不错 --------------------编程问答-------------------- 我知道可以返回dataset.我是要绑定到datalist里去.怎么写呢? --------------------编程问答-------------------- 还有.如果取得菜单的ID呢.菜单也是一个datalist --------------------编程问答-------------------- <asp:DataList ID="dlsubclasslist"  runat=server RepeatDirection=horizontal RepeatLayout="table">
                    <ItemTemplate>
                        <a onmouseover="return loadsubpic();" >
                            <%#Eval("SubClassName") %>
                        </a>
                    </ItemTemplate>
                </asp:DataList>

这是菜单.

菜单我不知道在js里怎么取得选中的ID.
-----------------------------------------
<script language="javascript" type="text/javascript">
        function loadsubpic()
        {
            var cid=document.getElementById("dlsubclasslist").value;
            Default4.ReturnPic(cid,loadsubpic_callback);
        }
        function loadsubpic_callback(res)
        {
            var area=document.getElementById("DataList1");
            var tbl=res.value;
            
            var tblHtml = "<table border=1>";      

       for(var i = 0; i < tbl.Rows.length; i++) 
       {
           tblHtml += "<tr>";
          for(var j = 0; j < tbl.Columns.length; j++)
           {
                 alert(tbl.Rows[j]["Title"]);
                 //tblHtml += "<td>" + tbl.Rows[i][tbl.Columns[j].Name] + "</td>";
           }
                tblHtml += "</tr>";
            }
            tblHtml += "</table>";
            
            area=null;
            area.innerHTML=tblHtml;
           
        }
</script>

-----------
<asp:DataList ID="DataList1" Width="100%" ItemStyle-HorizontalAlign=center ItemStyle- runat="server" RepeatDirection="horizontal" RepeatColumns=5>
                <ItemTemplate>
                    
                    <a  >
                        <img  src='<%#Eval("SPic")%>'/><br />
                        <font color=black><%#Eval("Title") %></font>
                    </a>
                </ItemTemplate>
            </asp:DataList>
---------------------------
上面这段是鼠标移到菜单时要显示的数据.
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,