repater显示效果问题 用repater显示如图片所示,每一个标题新闻下面都会有一个虚线,最后一个没有的,请问该如何设置呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把绑定的记录总数用一个静态变量来存储,然后在Reapter中的ItemDataBound中判断当前行是不是最后一行,若是就不显示下划线 #region 显示有用没用 protected void commentRpt_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView item = (DataRowView)e.Item.DataItem; int commentUserId = Convert.ToInt32(item["UserId"].ToString()); int level = Convert.ToInt32(item["Level"].ToString()); if (Request.IsAuthenticated) { //int index = e.Item.ItemIndex; //int userId=Convert .ToInt32(comment.Tables[0].Rows[index]["UserId"].ToString ()); if (userId == commentUserId) { e.Item.FindControl("viewlabel").Visible = false; e.Item.FindControl("assentLink").Visible = false; e.Item.FindControl("oppose").Visible = false; } else { e.Item.FindControl("viewlabel").Visible = true; e.Item.FindControl("assentLink").Visible = true; e.Item.FindControl("oppose").Visible = true; } } else { e.Item.FindControl("viewlabel").Visible = true; e.Item.FindControl("assentLink").Visible = true; e.Item.FindControl("oppose").Visible = true; } } #endregion这段代码也是在Repeater中判断显示与否 根本无须如此麻烦内容放在ItemTemplate, 而虚线等内容放在SeparatorTemplate里就OK了 虚线放在 裏<SeparatorTemplate></SeparatorTemplate> 做个1 X 1的黑点小图,加在TD里,就实现了 <span style="border-top:0px;border-left:0px;border-right:0px;border-bottom:2px dashed blue;width:100%;"> </span>显示虚线 急、急、急,图片特效 Js+CSS做的登录验证 sql 数据库恢复问题 【whb147】有事情找你联系QQ 4694 1598【关于公司招聘】 asp.net C#关闭页面后。转向一页面 如何使用别人写控件 关于UltraWebGrid事件的问题 大家帮一下,急死啦,万分感激! 一个简单的正则表达式问题 asp.net中的cookie问题 C#.net转换为VB.net代码问题 xp装sqlserver提示系统不支持怎么解决
protected void commentRpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DataRowView item = (DataRowView)e.Item.DataItem;
int commentUserId = Convert.ToInt32(item["UserId"].ToString());
int level = Convert.ToInt32(item["Level"].ToString());
if (Request.IsAuthenticated)
{
//int index = e.Item.ItemIndex;
//int userId=Convert .ToInt32(comment.Tables[0].Rows[index]["UserId"].ToString ());
if (userId == commentUserId)
{
e.Item.FindControl("viewlabel").Visible = false;
e.Item.FindControl("assentLink").Visible = false;
e.Item.FindControl("oppose").Visible = false;
}
else
{
e.Item.FindControl("viewlabel").Visible = true;
e.Item.FindControl("assentLink").Visible = true;
e.Item.FindControl("oppose").Visible = true;
}
}
else
{
e.Item.FindControl("viewlabel").Visible = true;
e.Item.FindControl("assentLink").Visible = true;
e.Item.FindControl("oppose").Visible = true;
}
}
#endregion这段代码也是在Repeater中判断显示与否
显示虚线