<asp:ListView ID="lv_Links" runat="server" > <LayoutTemplate> <ul style="list-style: none;"> <asp:PlaceHolder ID="ItemPlaceholder" runat="server" /> </ul> </LayoutTemplate> <ItemTemplate> <ul style="list-style: none;padding: 0;"> <li> <asp:HyperLink ID="LinkItem" runat="server" Text='<%# Eval("Description") %>' NavigateUrl='<%# Eval("Link") %>'> </asp:HyperLink> <asp:ImageButton ID="Button2" ImageUrl="~/_layouts/Portal.Croc.Box.Social.ForNewEmployee/i/delete.gif" itemid='<%# Eval("ID") %>' OnClick="delete_Onclick" OnClientClick="return confirm('Вы действительно хотите удалить ссылку?');" Width="14px" Height="14px" runat="server"/> </li> </ul> </ItemTemplate> </asp:ListView>
protected void Page_Load(object sender, EventArgs e) { SPWeb oWebs = SPContext.Current.Web; String Editors = "Новому сотруднику – модераторы"; String Owners = oWebs.Site.RootWeb.AssociatedOwnerGroup.ToString(); if (oWebs.SiteGroups[Editors].ContainsCurrentUser || oWebs.SiteGroups[Owners].ContainsCurrentUser) { HyperLink1.Visible = true; foreach (ListViewItem item in lv_Links.Items) { ImageButton ddrList = (ImageButton)item.FindControl("Button2") as ImageButton; ddrList.Visible = true; } } else { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)