前台循环绑定HTML控件
<script language="javascript" type="text/javascript">
function aaa()
{
var s="";
var v="";
var n="";
var index1="cbk_";
s=document.getElementsByName("qq");
for(var x=0;x<s.length;x++)
{
if(s[x].checked==true)
{
v=v+s[x].value+",";
}
else
{
n=n+s[x].value+",";
}
}
document.getElementById("hdf_id").value=v;
document.getElementById("hdf_nid").value=n;
// document.write(w);
// document.write(d);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td></td>
<td></td>
</tr>
</table>
<table>
<tr>
<td>Username</td>
<%
DBaccess DBA = new DBaccess();
int counti = DBA.countitems();
DV2 = DBA.selectitems();
DV3 = DBA.selectusers();
for (int i = 0; i < counti; i++)
{
%>
<td><%=HttpUtility.HtmlAttributeEncode(DV2[i]["itemname"].ToString())%></td>
<%
}
%>
</tr>
<%
int countu = DBA.countuser();
for (int i = 0; i < countu; i++)
{
%>
<tr>
<%
for (int j = 0; j < counti + 1; j++)
{
%>
<%
if (j == 0)
{
%>
<td><label><%=HttpUtility.HtmlAttributeEncode(DV3[i]["username"].ToString())%></label></td>
<%
}
%>
代码太多发布不出来