毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> net技术 >> 正文

repeater页面加载完成后,手动显示或隐藏某些列

更新时间:2013-3-11:  来源:毕业论文

repeater页面加载完成后,手动显示或隐藏某些列
我现在需要在页面加载完成后,手动显示或隐藏某些列。希望各位多多指教。
给那个列的每一个td标记一个class
然后用jqeury来实现

比如class="test"

$(".test").hide();这样既可隐藏 毕业论文 
在前台将Repeater中的Td标签设为服务器控件
实例:

前台:

//jQuery用来隐藏Repeater的表头列

function ViewOnly(){

    $("#thEdit").hide();

      $("#thDelete").hide();

      $("#tdNew").hide();

   }

 

<table width="100%" border="0" cellpadding="0" cellspacing="1" rules="all" class="tablebk"  >

                          <tr class="tablebtbg">

                           <th  scope="col" style="width: 110px;">酒店th>

                           <th  scope="col" style=" width:80px">区域</th>

                           <th  scope="col" style=" width:110px">负责人</th>

                           <th  scope="col" style=" width:60px">查看</th>

                           <th  scope="col" style=" width:60px" id="thEdit">修改</th>

                           <th  scope="col" style="width: 60px" id="thDelete">删除</th>   //TH用Javascript隐藏

                         </tr>

                             <asp:repeater id="RepList" runat="server" OnItemCommand="RepList_ItemCommand" OnItemDataBound="RepList_ItemDataBound">

                   <itemtemplate>

                        <tr align="center" class="bgbaise">

                            <td align="center">

                                <%#HtmlEncode(Eval("GrogshopName"))%>

                            </td>

                            <td align="center">

                                <%#HtmlEncode(Eval("GrogshopArea"))%>

                            </td>

                            <td align="center">

                                <%#HtmlEncode(Eval("Grogshopprincipal"))%>

                            </td>

                         

                           <td align="center">

                                <a href="../FrontCase/GrogshopInfo_Update.aspx<%#GetEncryptUrlQueryString(Container.DataItem,"View") %>">查看</a>

                            </td>

                            <td align="center" runat="server" id="tdEdit">  //设为服务器控件后台操作

                                <a href="../FrontCase/aa.aspx<%#GetEncryptUrlQueryString(Container.DataItem,"Edit") %>">修改</a>

                            </td>

                            <td align="center" runat="server" id="tdDelete"> //设为服务器控件后台操作

                                <asp:LinkButton ID="lbtnDel" CommandArgument='<%#HtmlEncode(Eval("GrsID")) %>' CommandName="Del" runat="server"><span onclick="return confirm('是否删除记录?');">删除</span></asp:LinkButton>

                            </td>

                        </tr>

                        </itemtemplate>

              </asp:repeater>

                       </table>

 

后台:

//调用前台的Javascript函数

this.ClientJavaScript("ViewOnly();");

 

protected void RepList_ItemDataBound(object sender, RepeaterItemEventArgs e)

        {

            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)

            {

            

                    //,Common.SystemRole.Receive

                    HtmlTableCell tdEdit = e.Item.FindControl("tdEdit") as HtmlTableCell;

                    HtmlTableCell tdDelete = e.Item.FindControl("tdDelete") as HtmlTableCell;

                    tdEdit.Visible = false;

                    tdDelete.Visible = false;

                //隐藏编辑、删除列            }        }

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。