zoukankan      html  css  js  c++  java
  • 不用控件直接输出排版

     //new1研发先锋
            public string GetInfo_yanf()
            {
                //绑定数据
                string strSql = "select ID,Title,Name,SmallImageUrl,Vote_PS from tb_news where CaseType=1 and SorID=1";
                DataSet ds = dbObj.Query(strSql);
    
    
    
                StringBuilder strbul = new StringBuilder();
    
                strbul.Append("<div>");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    int j = i + 1;
                    string strtit = ds.Tables[0].Rows[i]["Name"].ToString();
                    string strurl = ds.Tables[0].Rows[i]["SmallImageUrl"].ToString();
                    string strid = ds.Tables[0].Rows[i]["ID"].ToString();
                    string strtoal = ds.Tables[0].Rows[i]["Vote_PS"].ToString();
    
                    strbul.Append("<div class='Votingbox'>");
    
                    strbul.Append("<div class='vImg'>");//候选人图片
                    strbul.AppendFormat("<img width='132px' height='102' alt='{0}' src='{1}' />", "图片", strurl);//候选人图片
                    strbul.Append("</div>");//候选人图片
                    strbul.Append("<div class='vName'>" + strtit + "</div>");//候选人Name
                    strbul.Append("<div class='vLink'><a href='peoplenews.aspx?ID=" + strid + "'>【先进事迹】</a></div>");
                    strbul.Append("<div class='v'>");
                    strbul.Append("<input id='" + strid + "' type='checkbox' onclick='SetCheckBoxValue()'  />");
                    strbul.Append("<label for='CheckBoxnew'>A"+j+" 网络票:" + strtoal + "</label>");
                    strbul.Append("</div>");
                    strbul.Append("</div>");
    
                }
                strbul.Append("</div>");
                return strbul.ToString();
            }
  • 相关阅读:
    css优化总结
    几种常用的图片格式
    css布局总结
    第四章复习题
    4.9,4.10
    4.8
    4.7指针
    libffi
    代理模式
    Redis 汇总
  • 原文地址:https://www.cnblogs.com/juexin/p/3003586.html
Copyright © 2011-2022 走看看