zoukankan      html  css  js  c++  java
  • jQuery结合asp.net生成页表

    protected void Page_Load(object sender, EventArgs e)
            {
                Literal1.Text = "<ul id=Gid>";

                for (int i = 0; i < GetGroups().Count; i++)
                {
                    Literal1.Text += @"<li><a href=#fragment-" + i + "><span>" + GetGroups()[i] + "</span></a></li>";
                }
                Literal1.Text += "</ul>";

                        

                for (int i = 0; i < GetGroups().Count; i++)
                {
                    Literal1.Text += @"<div id=fragment-" + i + "><TABLE id=Tid border=0 cellspacing=0 cellpadding=0 class=flora>";
                    Literal1.Text += @"<TR>";
                    for (int j = 1; j < GetDetail().Count+1; j++)
                    {
                        Literal1.Text += @"<TD >" + GetDetail()[j - 1];
                        Literal1.Text += @"</TD>";
                       

                        if (j % GetRepeats() == 0)
                        {
                            Literal1.Text += @"</TR><TR>";
                        }
                    }
                    Literal1.Text += @"</TR></TABLE></div>";
                }

            }

            public List<string> GetGroups()
            {
                List<string> Groups = new List<string>();

                for (int i = 0; i < 3; i++)
                {
                    Groups.Add("测试组" + i.ToString());
                }

                return Groups;

            }

            public List<string> GetDetail()
            {
                List<string> Details = new List<string>();

                for (int i = 0; i < 7; i++)
                {
                    Details.Add("名称:" + i.ToString() + "<INPUT TYPE=text NAME=T" + i + " ID=T" + i + " height=1 runat=server value=" + System.Guid.NewGuid().ToString().Substring(0, 5) + ">");
                }

                return Details;

            }

           

            public int GetRepeats()
            {
                return 2;
            }

            protected void Button1_Click(object sender, EventArgs e)
            {
            
                Response.Write(Request.Params["T1"].ToString());

             }

    关于作者: 王昕(QQ:475660) 在广州工作生活30余年。十多年开发经验,在Java、即时通讯、NoSQL、BPM、大数据等领域较有经验。
    目前维护的开源产品:https://gitee.com/475660
  • 相关阅读:
    tornado中form表单验证详解
    关于tornado中session的总结
    Linux常用命令
    css3动画属性详解 与超酷例子
    keepalive高可用的健康检查
    keepalive的nginx防火墙问题
    安装配置hadoop
    tmux的简单快捷键
    部署使用elk
    k8s搭建部署
  • 原文地址:https://www.cnblogs.com/starcrm/p/1310640.html
Copyright © 2011-2022 走看看