本文介绍了无法修改控件集合,因为控件包含代码块(即<%...%>)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%@ Page Language =vbAutoEventWireup =falseCodeBehind =NoticeboardDocs.aspx.vb Inherits =CBRE.TSP.Web.NoticeboardDocs%> ; <%@ Import Namespace =Common%> < html xmlns =www.w3/1999/xhtml> < head id =Head1runat =server> < title>布告牌文件< / title> < link type =text / csshref =../ Styles / grid / css / grid.css =stylesheet/> < link type =text / csshref =../ Styles / grid / css / round.css =stylesheet/> < link type =text / csshref =../ Styles / grid / css / core.css =stylesheet/> < link href =../ Styles / reskin / screen.csstype =text / css =stylesheet/> < script type =text / javascript> 函数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'> 关闭< / a>< div class ='iframe-holder'style ='overflow:auto; -webkit-overflow-scrolling:touch;'>< iframe scrolling ='yes'>< / iframe> < / DIV>< / DIV>< / DIV> 中。)appendTo( 身); 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(); 返回false; }); } else { window.open(../ User / ShowDocument.aspx?DocumentID =+ docId,_ blank,height = 700,width = 900,location =没有,菜单栏=没有,可调整大小=是,滚动条=是,标题栏=没有,工具栏=没有,顶部= 50,左= 50\" ); } } } 函数closeHandler(){ $ .ajax( { type:'post' , url:'.. / User / ShowDocument.aspx / DeleteOpenedFile', contentType:application / json; charset = utf-8, datatype:'json',成功:功能(结果){} })}; < / script> < / head> < body> < asp:PlaceHolder ID =PlaceHolder1runat =server> < form id =form1runat =server> < div id =mainfr_right> < div class =wsmdivmain> < p id =pagetitle> < asp:Label runat =serverID =lblPageTitleText =Documents Attached>< / asp:Label> < / p> < br /> < asp:GridView ID =gvDocsrunat =serverCaptionAlign =TopCellPadding =1CellSpacing =2 AutoGenerateColumns =FalseWidth =100%DataKeyNames = DocumentId > < HeaderStyle CssClass =webGridheaderStyleHorizontalAlign =Center/> < RowStyle CssClass =webGridrowStyleWrap =true/> < AlternatingRowStyle CssClass =webGridalternatingStyleHorizontalAlign =Center/> < Columns> < asp:TemplateField HeaderText =Filename> < ItemTemplate> < asp:HyperLink ID =HyperLink1runat =serverNavigateUrl ='Javascript:void(0);' onclick ='<%#ShowDocument(& Encryption .EncryptParameter(DataBinder.Eval(Container.DataItem,DocumentID))&);返回false;%>' Target =_ blankText ='<%#Eval( DocumentName)%>'> < / asp:HyperLink> < / ItemTemplate> < ItemStyle HorizontalAlign =Center/> < / asp:TemplateField> < asp:BoundField DataField =FilesizeHeaderText =Size(bytes)ItemStyle-HorizontalAlign =center> < ItemStyle HorizontalAlign =center>< / ItemStyle> < / asp:BoundField> < asp:BoundField DataField =CreatedHeaderText =Date UploadedItemStyle-HorizontalAlign =center> < ItemStyle HorizontalAlign =center>< / ItemStyle> < / asp:BoundField> < / Columns> < / asp:GridView> < / div> < / div> < / form> < / asp:PlaceHolder> < / body> < / html>
受保护的覆盖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)然后退出Sub 使用css .Href = stylesheet 。属性(rel)=stylesheet。属性(type)=text / css以 结束MyBase.Header.Controls.Add(css) End Sub 受保护的子Page_Load(ByVal sender As Object,ByVal e As System.EventArgs)处理Me.Load 如果不是Page.IsPostBack那么 Dim iNoticeboardId = Request.QueryString( NoticeboardId) LoadDocsGrid(iNoticeboardId) 结束如果结束子
我尝试过: i已经把
引用:< asp:PlaceHolder ID =PlaceHolder1runat =server>
,但我做了没有工作!!
解决方案(< div class ='full-popup'>< div class ='file-popup'>< a href ='#'onclick ='javascript:closeHandler();'class ='close-full-popup'> 关闭< / 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(){ <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="NoticeboardDocs.aspx.vb" Inherits="CBRE.TSP.Web.NoticeboardDocs" %> <%@ Import Namespace="Common" %> <html xmlns="www.w3/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
What I have tried: i have put
Quote:<asp:PlaceHolder ID="PlaceHolder1" runat="server">
in body but i did not worked !!
解决方案 ("<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 () {更多推荐
无法修改控件集合,因为控件包含代码块(即<%...%>)。
发布评论