有谁知道json吗,根据两个参数,到ashx里面去做处理,等到一下arraylist,把得到的arraylist循环的给页面上的textbox,想要模拟的例子
有谁知道json吗,根据两个参数,到ashx里面去做处理,等到一下arraylist,把得到的arraylist循环的给页面上的textbox,想要模拟的例子 --------------------编程问答-------------------- json类似于hash table --------------------编程问答-------------------- 恩,你有类似的例子吗 --------------------编程问答-------------------- 得到 json = "[" + string.Join(",", RegUserNames) + "]",我要办他循环的给<input type="text" name="txtReg1"/> ,<input type="text" name="txtReg2"/>。。。等等 --------------------编程问答-------------------- 有谁知道吗--------------------编程问答--------------------
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;
......
}
前台也很简单哦
<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;
}
补充:.NET技术 , ASP.NET