我想把第一行的向上隐藏,最后一行的向下隐藏
我的前台代码是这样的: <ItemTemplate>
<tr class="td_on" onmouseover="this.className='td_off'" onmouseout="this.className='td_on'">
<td class="usertablerow1" align="center" width="8%">
<asp:CheckBox ID="chkSelect" runat="server" />
</td>
<td class="usertablerow1" align="center" width="15%">
<asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Id")%>'
Visible="false"></asp:Label><a href='Products.aspx?id=<%#DataBinder.Eval(Container.DataItem,"Id") %>'><%#DataBinder.Eval(Container.DataItem,"Title") %></a>
</td>
<td class="usertablerow1" align="center" width="10%">
<%#Eval("ProductSort")%>
</td>
<td class="usertablerow1" align="center" width="13%">
<%#Eval("ProTypeZH") %>
</td>
<td class="usertablerow1" align="center" width="13%">
<a href="../upload/bigImg/<%#Eval("BigPhoto") %>" rel="lightbox[1]" title="<%#Eval("Title") %>">查看图片</a>
</td>
<td class="usertablerow1" align="center" width="10%">
<%#Eval("recommend").ToString() == "False" ? "不推荐" : "推荐"%>
</td>
<td class="usertablerow1" align="center" width="8%">
<%-- <%#Eval("ProductSort")%>--%><asp:ImageButton ID="ImageButton1" runat="server" CommandName="up" CommandArgument='<%# Eval("ProductSort") %>' ImageUrl="~/Admin/images/Rup.jpg"/><asp:ImageButton ID="ImageButton2" CommandName="down" CommandArgument='<%# Eval("ProductSort") %>' runat="server" ImageUrl="~/Admin/images/Rdown.jpg"/>
</td>
<td class="usertablerow1" align="center" width="12%">
<%#Eval("Language")%>
</td>
<td class="usertablerow1" align="center" width="10%">
<a href='Products.aspx?id=<%#DataBinder.Eval(Container.DataItem,"Id") %>'>编辑</a>
</td>
</tr>
</ItemTemplate>
后台代码我自个写的好像不能实现啊 protected void RepNews_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
foreach (RepeaterItem item in RepNews.Items)
{
ImageButton Imbtn1 = item.FindControl("ImageButton1") as ImageButton;
ImageButton Imbtn2 = item.FindControl("ImageButton2") as ImageButton;
if (13 == DbHelp.ExistsCount("select top 1 ProductSort from T_Product order by ProductSort desc"))
{
Imbtn1.Visible = false;
}
if (2 == DbHelp.ExistsCount("select top 1 ProductSort from T_Product order by ProductSort asc"))
{
Imbtn2.Visible = false;
}
}
}
解决方案 »
- iframe做成在线文本编辑器,如何实现highlight?
- 关于一个循环截取字符串的C#问题
- 请问谁知道Foxmail邮箱pop.foxmail.com的 pop的端口号是多少???????????
- 作一个调查,您们在绑定数据时,使用dataview,还是datalist,或者repeater?我发现dataview样式很难看?
- Parameters一个奇怪的问题
- 请问dropdownlist控件可以设成可编辑的吗?
- 也很奇怪的一个问题,究竟是怎么回事儿啊?!
- 关于checkbox和radiobutton的问题。
- 做了一个防止二次打开WEB页面的例子,有源码,请大家进来测试一下,看是否有漏洞(详情见内)...
- DataReader的奇怪问题,没有数据时DataReader.Read()返回true,我如何是好?
- 求助:网站上传到服务器上之后出现BUG(补充)
- 关于jquery调用后台的问题
int i = 0
foreach (RepeaterItem item in RepNews.Items)
{
ImageButton Imbtn1 = item.FindControl("ImageButton1") as ImageButton;
ImageButton Imbtn2 = item.FindControl("ImageButton2") as ImageButton;
if (i == 0 {
Imbtn1.Visible = false;
}
if (i == RepNews.Items.Count - 1)
{
Imbtn2.Visible = false;
}
i++;
}
{
int index = e.Item.ItemIndex;
if (index == 0)
{
ImageButton Imbtn1 = item.FindControl("ImageButton1") as ImageButton;
Imbtn1.Visible = false;
}
if (index == RepNews.Items.Count - 1)
{
ImageButton Imbtn2 = item.FindControl("ImageButton2") as ImageButton;
Imbtn2.Visible = false;
}
}