62,046
社区成员
发帖
与我相关
我的任务
分享
<form id="form1" runat="server">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="tableCol">
<tr>
<td height="24" style="padding-left:8px;padding-top:3px;"><img src="../Images/green_plus.gif" width="16" height="16" align="absmiddle" /> <asp:Label ID="comtitle" runat="server" Text="Label">公司设置</asp:Label></td>
</tr>
</table>
<asp:Repeater ID="comList" runat="server">
<HeaderTemplate>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B4D7EB" style="margin-top:3px;">
<tr>
<th width="5%" height="23" bgcolor="#DFEEF5">序号</th>
<th width="75%" bgcolor="#DFEEF5">公司名称</th>
<th width="12%" align="center" bgcolor="#DFEEF5">操作</th>
<th width="8%" align="center" bgcolor="#DFEEF5">选择</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td height="23" bgcolor="#FFFFFF" style="font-weight:bold; font-family:Arial; text-align:center;"><%# Container.ItemIndex + 1 %>
</td>
<td bgcolor="#FFFFFF"style="padding-left:6px;text-align:left"><%#DataBinder.Eval(Container.DataItem, "SFL_Org_Name")%></td>
<td align="center" bgcolor="#FFFFFF"><a href="orgEdit.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"SFL_Org_ID") %>">修改</a> | <a href="delEdit.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"SFL_Org_ID") %>">删除</a></td>
<td bgcolor="#FFFFFF" align="center"><asp:CheckBox ID="Chk" runat="server" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#b4d7eb" style="margin-top:3px;">
<tr>
<td height="24" bgcolor="#eff7ff" style="font-family:Arial;text-align:left;padding-left:10px;">
<asp:Button ID="Button2" runat="server" Text="删除选定" CssClass="Button" OnClick="Button2_Click1" /></td>
</tr>
</table>
</form>
public partial class Hr_Default : System.Web.UI.Page
{
BLL.main Org = new BLL.main();
Model.Org sqlstr = new Model.Org();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
comDatabind();
}
}
public void comDatabind()
{
sqlstr.sqlOrg = "SELECT * FROM SFL_Org";
DataSet ds = Org.getOrg(sqlstr);
comList.DataSource = ds;
comList.DataBind();
}
protected void Button2_Click1(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (RepeaterItem item in comList.Items)
{
CheckBox check = (CheckBox)item.FindControl("Chk");
if (check != null)
{
if (check.Checked == true)
{
sb.Append(check.Checked.ToString());
sb.Append(",");
}
}
}
Response.Redirect(sb.ToString());
}
}
StringBuilder sb = new StringBuilder();
foreach (RepeaterItem item in RList.Items)
{
CheckBox check = (CheckBox)item.FindControl("Chk");
if (check != null)
{
if (check.Checked)
{
sb.Append(check.ToolTip);
sb.Append(",");
}
}
}
Response.Write(sb.ToString());
if (check.Checked) sb.Append('true,');