使用json绑定Listview [英] binding Listview using json

查看:64
本文介绍了使用json绑定Listview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai,



i希望使用json绑定listview,在客户端绑定数据



hai,

i want to bind listview using json,bind data in clientside

<%--<asp:ListView ID="LVperticular" runat="server"
                    >
 <LayoutTemplate>
            <table runat=" server" id=" table1">
              <tr runat=" server" id=" groupPlaceholder">                               
              </tr>
            </table>
        </LayoutTemplate>
          <ItemTemplate>
              <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/arrowlinkbutton.gif" Width="10px"  Height="10px"  />

            <asp:Label ID="lblParticular" runat="server" Text='<%#Bind("Particulars") %>' CssClass="lvParticulars"></asp:Label>

            <asp:Label ID="lblQuantity" runat="server" Text='<%# Bind("CurrentQuantity") %>' CssClass="lvCurrentQuantity" Font-Bold="True" Font-Size="Smaller"  ForeColor="Red"></asp:Label><br /><br />

            </ItemTemplate>
    </asp:ListView>--%>





服务器端以xml格式返回数据

这是我的网络方式

< br $>


公共静态字符串ButtonOkStockTransfer(string StockId)

{





DataTable dtSession =(DataTable)System.Web.HttpContext.Current.Session [OutStockTransfer];



bl_T_StockTransfer objOut = new bl_T_StockTransfer() ;

objOut.companyId = Convert.ToInt64(System.Web.HttpContext.Current.Session [CompanyId]。ToString());

objOut.financialId = Convert.ToInt64(System.Web.HttpContext.Current.Session [ FinancialId]。ToString());

objOut.branchId = Convert.ToInt64(System.Web.HttpContext.Current.Session [BranchId]。ToString());

objOut.stockId = Convert.ToInt64(StockId);

DataSet dtOut = objOut.get_StockDetails(StockId);

dtOut.Tables [0] .TableName = TransferStock;









返回dtOut.GetXml() ;

}



请帮帮我,这些xml数据我想绑定我的listview



in server side return data in xml format
this is my web method


public static string ButtonOkStockTransfer(string StockId)
{


DataTable dtSession = (DataTable)System.Web.HttpContext.Current.Session["OutStockTransfer"];

bl_T_StockTransfer objOut = new bl_T_StockTransfer();
objOut.companyId = Convert.ToInt64(System.Web.HttpContext.Current.Session["CompanyId"].ToString());
objOut.financialId = Convert.ToInt64(System.Web.HttpContext.Current.Session["FinancialId"].ToString());
objOut.branchId = Convert.ToInt64(System.Web.HttpContext.Current.Session["BranchId"].ToString());
objOut.stockId = Convert.ToInt64(StockId);
DataSet dtOut = objOut.get_StockDetails(StockId);
dtOut.Tables[0].TableName = "TransferStock";




return dtOut.GetXml();
}

pls help me,these xml data i want to bind my listview

推荐答案

这里的例子解释了如何使用json和jquey将数据绑定到网格视图希望这个例子可以帮助你将数据绑定到List视图



< a href =http://www.aspdotnet-suresh.com/2012/ 03 / bind-data-to-gridview-with-jquery-or.html>在asp.net中使用JQuery或JSON将数据绑定到gridview [ ^ ]
Here is the Example explains how to bind data to grid view using json and jquey hope this example helps you to bind data to List view

Bind data to gridview with JQuery or JSON in asp.net[^]


这篇关于使用json绑定Listview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆