//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(); }