• 不用控件直接输出排版


     //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();
            }
  • 相关阅读:
    【TensorFlow篇】--Tensorflow框架可视化之Tensorboard
    UTF-8与UTF-8(BOM)区别
    JSP response.setCharacterEncoding与response.setContentType的区别
    Tomcat启动报错org.apache.catalina.core.StandardContext listenerStart
    JS 变量作用域
    JS 函数
    JS中typeof的用法
    JS Map与Set
    JS 选择结构语句与循环结构语句
    JS 对象
  • 原文地址:https://www.cnblogs.com/juexin/p/3003586.html
Copyright © 2020-2023  润新知