有谁知道json吗,根据两个参数,到ashx里面去做处理,等到一下arraylist,把得到的arraylist循环的给页面上的textbox,想要模拟的例子

解决方案 »

  1.   

    得到 json = "[" + string.Join(",", RegUserNames) + "]",我要办他循环的给<input type="text" name="txtReg1"/> ,<input type="text" name="txtReg2"/>等等
      

  2.   


            public IList<TBWriterInfo> Findbyname(int page, int pagesize, string name, out int total)
            {
                total = 0;
                string stmtID = "TBWriterInfoGen-P_WriteList";
                Hashtable ht = new Hashtable();
                ht.Add("name", name);
                ht.Add("PageIndex", page - 1);
                ht.Add("PageSize", pagesize);
                ht.Add("total", total);
                IList<TBWriterInfo> result = Instance.QueryForList<TBWriterInfo>(stmtID, ht);
                total = Convert.ToInt32(ht["total"].ToString());
                return result;
            }IList<TBWriterInfo> list = ITBW.Findbyname(page, myPage.PageSize, name, out total)
                  foreach (TBWriterInfo s in list)
                {
                           lblAchievement.Text = s.Achievement;
                           lblName.Text = s.Name;
                           ......            }
      

  3.   

    前台也很简单哦<div>
        <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtsex" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtclass" runat="server"></asp:TextBox>
        <asp:TextBox ID="txttel" runat="server"></asp:TextBox>
    </div>这样的就可以在.cs文件中直接用ID.text=你所取到的数据 来展现在页面上,如:IList<TBWriterInfo> list = ITBW.Findbyname(page, myPage.PageSize, name, out total)
                  foreach (TBWriterInfo s in list)
                {
                           txtname.Text = s.name;
                           txtsex.Text = s.sex;
                           txtclass.Text=s.class;
                           txttel.text=s.tel;
                }