在后台拼接了一个table传到前台显示了出来,

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

public string GetTable()

        {

            StringBuilder sb = new StringBuilder();

            sb.Append("<table id=\"table_top\"  class=\"tableCss\" style=\"color:#ffffff\">");

            sb.Append("<tr><td class=\"auto-style1\">任务编码</td><td class=\"auto-style6\">&nbsp;</td><td class=\"auto-style1\">任务数量</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style1\">产品名称</td><td colspan=\"3\">&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style1\">组托规范</td><td colspan=\"3\">&nbsp;</td></tr>");

            sb.Append("</table>¥");

            sb.Append("<table class=\"auto-style3\" id=\"table2\">");

            sb.Append("<tr><td class=\"auto-style1\">任务状态</td><td class=\"auto-style4\" id=\"renwu\"></td></tr>");

            sb.Append("<tr><td class=\"auto-style1\">托盘状态</td><td class=\"auto-style4\" id=\"tuopan\"><span id=\"zhengchang\">正常</span><span id=\"cuowu\">错误</span></td></tr>");

            sb.Append("<tr><td class=\"auto-style1\">累计失败</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style1\">当前数量</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style1\">累计成功</td><td>&nbsp;</td></tr>");

            sb.Append("</table>¥");

            sb.Append(" <table class=\"auto-style3\" id=\"table3\" style=\"color:#ffffff\">");

            sb.Append("<tr><td class=\"auto-style1\">托盘识别码</td><td colspan=\"2\">&nbsp;</td></tr>");

            sb.Append("<tr><td rowspan=\"7\" class=\"auto-style1\">扫描队列</br>滚动记录</td><td class=\"auto-style5\">1</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style5\">2</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style5\">3</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style5\">4</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style5\">5</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style5\">6</td><td>&nbsp;</td></tr>");

            sb.Append("<tr><td class=\"auto-style5\">7</td><td>&nbsp;</td></tr>");

            sb.Append("</table>");

            return sb.ToString();

        }


上面是我拼的表,下面是我前台的
 

Plain Text code?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

function table() {

            $.ajax({

                url: "Ash/index.ashx",

                type: "GET",

                dataType: "text",

                data: {"ID":""},

                error: function (XMLHttpRequest, textStatus, errorThrown) {

                 

                },

                success: function (sb) {

                    var table1 = '<table class="tableCss" style="color:#FFFFFF">'

                    $("#top").html(sb.split("¥")[0]);

                    $("#middle_left").html(sb.split("¥")[1]);

                    $("#mieele_right").html(sb.split("¥")[2]);

                     

                }

            });

        }



这是现在的界面图


这是要求的界面



这是我的ajax后台查询语句

C# code?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

 public void ProcessRequest(HttpContext context)

        {

            context.Response.Write(GetTable()+"¥");

            //查询状态为开始的任务

            DataTable dtStar = _lzbll.GetList(1,"flag=2","").Tables[0];

            string a = ToJson(dtStar);

            if (dtStar.Rows.Count > 0)

            {

                context.Response.Write(a);

            }

            //没查到,则按时间顺序查找最后面的数据

            else

            {

                dtStar = _lzbll.GetList(1, """CreatedOn").Tables[0];

                context.Response.Write(a);

            }

        }




请问怎么把我查到的数据插进相应的表格

问题点数:40分

0 0

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值