复制代码 代码如下:
<asp:Repearter runat="server" onitemdatabound="Repeater1_ItemDataBound">
<ItemTemplate>
<tr>
<td>
<input type="checkbox">
</td>
<td>
<%#Eval("studentId") %>
</td>
<td>
<asp:Label runat="server" Text="">
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DataRowView drv = (DataRowView)e.Item.DataItem;
if (drv["sex"].ToString()=="0")
{
((Label)e.Item.FindControl("lblSex")).Text = "男";
}
else ((Label)e.Item.FindControl("lblSex")).Text = "女";
}
复制代码 代码如下:
private void assets_ItenDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{
DataRowView drv=(DataRowView)e.Item.DataItem;
string m=(string)drv["ID"];
int i=_userMenuBll.AssetsCss(m);
switch(i)
{
case 0:e.Item.CssClass="nomal";break;
case 1:e.Item.CssClass="red";break;
case 2:e.Item.CssClass="purple";break;
case 3:e.Item.CssClass="yellow";break;
case 4:e.Item.CssClass="blue";break;
case 5:e.Item.CssClass="green";break;
}
}
新闻热点
疑难解答
图片精选