Коллекция элементов управления не может быть изменена, поскольку элемент управления содержит блоки кода (т. е. <% ... %и GT;).
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="NoticeboardDocs.aspx.vb" Inherits="CBRE.TSP.Web.NoticeboardDocs" %> <%@ Import Namespace="Common" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Noticeboard Documents</title> <link type="text/css" href="../Styles/grid/css/grid.css" rel="stylesheet" /> <link type="text/css" href="../Styles/grid/css/round.css" rel="stylesheet" /> <link type="text/css" href="../Styles/grid/css/core.css" rel="stylesheet" /> <link href="../Styles/reskin/screen.css" type="text/css" rel="stylesheet" /> <script type="text/javascript"> function ShowDocument(docId) { if (docId > 0 || docId != "") { var isMobileLogin = '<%= Session("isMobile") %>'; var isMob = false; if (isMobileLogin != 'undefined') { if (isMobileLogin == "true") { isMob = true; } } if (isMob == true) { $("<div class='full-popup'><div class='file-popup'><a href='#' onclick='javascript:closeHandler();' class='close-full-popup'> Close</a><div class='iframe-holder' style='overflow:auto; -webkit-overflow-scrolling:touch;'><iframe scrolling='yes'></iframe></div></div></div>").appendTo("body"); var src = "../User/ShowDocument.aspx?DocumentID=" + docId; $(".full-popup iframe").attr("src", src + "#view=fit"); $(document).on("click", ".close-full-popup", function () { $(this).parents(".full-popup").detach(); return false; }); } else { window.open("../User/ShowDocument.aspx?DocumentID=" + docId, "_blank", "height=700,width=900,location=no,menubar=no,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no,top=50,left=50"); } } } function closeHandler() { $.ajax( { type: 'post', url: '../User/ShowDocument.aspx/DeleteOpenedFile', contentType: "application/json; charset=utf-8", datatype: 'json', success: function (result) { } }) }; </script> </head> <body> <asp:PlaceHolder ID="PlaceHolder1" runat="server"> <form id="form1" runat="server"> <div id="mainfr_right"> <div class="wsmdivmain"> <p id="pagetitle"> <asp:Label runat="server" ID="lblPageTitle" Text="Documents Attached"></asp:Label> </p> <br /> <asp:GridView ID="gvDocs" runat="server" CaptionAlign="Top" CellPadding="1" CellSpacing="2" AutoGenerateColumns="False" Width="100%" DataKeyNames="DocumentId"> <HeaderStyle CssClass="webGridheaderStyle" HorizontalAlign="Center" /> <RowStyle CssClass="webGridrowStyle" Wrap="true" /> <AlternatingRowStyle CssClass="webGridalternatingStyle" HorizontalAlign="Center" /> <Columns> <asp:TemplateField HeaderText="Filename"> <ItemTemplate> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='Javascript:void(0);' onclick='<%# "ShowDocument(""" & Encryption.EncryptParameter(DataBinder.Eval(Container.DataItem, "DocumentID")) & """); return false;"%>' Target="_blank" Text='<%# Eval("DocumentName") %>'> </asp:HyperLink> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> <asp:BoundField DataField="Filesize" HeaderText="Size (bytes)" ItemStyle-HorizontalAlign="center"> <ItemStyle HorizontalAlign="center"></ItemStyle> </asp:BoundField> <asp:BoundField DataField="Created" HeaderText="Date Uploaded" ItemStyle-HorizontalAlign="center"> <ItemStyle HorizontalAlign="center"></ItemStyle> </asp:BoundField> </Columns> </asp:GridView> </div> </div> </form> </asp:PlaceHolder> </body> </html>
Protected Overrides Sub OnInit(e As System.EventArgs) MyBase.OnInit(e) Dim css As New HtmlLink Dim stylesheet As String = ThemeWrapper.GetMyTheme.TenantStyleSheet If String.IsNullOrEmpty(stylesheet) Then Exit Sub With css .Href = stylesheet .Attributes("rel") = "stylesheet" .Attributes("type") = "text/css" End With MyBase.Header.Controls.Add(css) End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then Dim iNoticeboardId = Request.QueryString("NoticeboardId") LoadDocsGrid(iNoticeboardId) End If End Sub
Что я уже пробовал:
я поставил
в теле но у меня ничего не получалось !!Цитата:&ЛТ;АСП:заполнитель идентификатор="PlaceHolder1" атрибут runat="сервер"и GT;