是否可以确定内容占位符的最小高度 [英] Is it possible to fix the minimum height of a content place holder

查看:121
本文介绍了是否可以确定内容占位符的最小高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临一个问题,如果单个结果发现内容占位符变得太短,我的页面的页脚位于页面中间,我在搜索按钮单击后搜索页面。是否可以修复内容占位符的最小高度和最大限制。



 <   asp:内容    ID   =  Content3    ContentPlaceHolderID   =  ContentPlaceHolder1    runat   = 服务器  >  
< 表格 id = form1 runat = 服务器 >
< width = 100% style = height:100px >
< tr >
< td >
< h3 style = margin-left:23px; >
结果< / h3 >
< / td >
< ; / tr >
< / table >
< div id = noresults < span class =code-attribute> runat = server align = center style = width:100%; >
< / div >
< asp:GridView ID = grdView runat = server AutoGenerateColumns = 错误 CssClass = grd

CellPadding = 0 < span class =code-attribute> AllowPaging
= true ForeColor = #333333 GridLines = OnRowDataBound = grdView_RowDataBound

DataKeyNames = Id OnRowCommand = grdView_RowCommand 宽度 = 90% OnPageIndexChanging = grdView_PageIndexChanging >
< AlternatingRowStyle CssClass = AlternateRowStyle / >
< FooterStyle BackColor = #C3FDB8 Font-Bold = True < span class =code-attribute> ForeColor = #212121 / >
< RowStyle BackColor = #FFFFFF ForeColor = #333333 CssClass = RowStyle / >
< PagerStyle BackColor = #E5E2E2 < span class =code-attribute> ForeColor = #212121 Horizo​​ntalAlign = 正确 /
>
< SelectedRowStyle BackColor = #41F738 Font-Bold = True ForeColor = #333333 / >
< ; HeaderStyle 字体粗体 = True ForeColor = #212121 Horizo​​ntalAlign = 宽度 = 150px / >
< EditRowStyle BackColor = #999999 / >
<% - < AlternatingRowStyle BackColor = White ForeColor = #333333 /> - %>
< > ;
< asp:TemplateField ItemStyle-Width = 70px >
< ItemTemplate >
< asp:Panel ID = pan runat = < span class =code-keyword> server CssClass = temp >
<% #Container.DataItemIndex + 1 %> < b / >
< / asp:Panel >
< / ItemTemplate >
< / asp:TemplateField >
< asp:TemplateField >
< ItemTemplate >
< b >
< asp:Label ID = lblQuestion runat = 服务器 文本 =' <% #Bind( 问题%> ' >


< / asp:Label > < / b > < br / >
< asp:标签 ID = lblDescription runat = 服务器 文字 =' <% #Bind( 描述%> ' >

< / asp:Label >
< / ItemTemplate >
< / asp:TemplateField >
<% - < asp:TemplateField>
< ItemTemplate>
< asp:Label ID = lblDescription runat = server Text = ' <%#Bind(Description)%>' >

< / asp:标签 >
< / ItemTemplate >
< / asp:TemplateField > - %GT;
< asp:TemplateField ItemStyle-Width = 140px >
< ItemTemplate >
< asp:Panel ID = < span class =code-keyword> panel runat = server CssClass = panel2 >
发布者
< asp:标签 ID = lblUserName runat = server 文字 =' <% #Bind( UserName%> ' > < / asp:Label >
< br / >
< span class =code-pagedirective><% - < asp:Label ID = lblNoofReply runat = server Text = ' <%#Bind(NoOfReply)%>' > < / asp:标签 >
- %>
< asp:LinkBut​​ton ID = btnNoOfReply runat = 服务器 文字 =' <% #Eval( < span class =code-string> NoOfReply%> '

CommandArgument < span class =code-keyword> =' <% #Eval( Id%> ' CommandName = 选择 > < span class =code-keyword>< / asp:LinkBut​​ton >
< / asp:Panel >
< / ItemTemplate > ;
< / asp:TemplateField >
< /列 >
< ; / asp:GridView >
< / form >
< / asp:Content >

解决方案

ContentPlaceHolder将始终调整大小以适应其周围和内部的其他元素。那是因为ContentPlaceHolder不是可视控件;也就是说,它不会在最终的HTML中产生任何标记。它只是添加其他内容的标记区域。



如果你想用固定大小构建东西,给它周围和内部的元素提供(CSS)尺寸。占位符。



参考 [ ^ ]


访问此处...



< a href =http://forums.asp.net/t/1081037.aspx> http://forums.asp.net/t/1081037.aspx [ ^ ]







http://www.sitefinity.com/developer-network/forums/bugs-issues-/bug-empty-placeholder-with-min-height-not-dropable-4 - 2-1650 [ ^ ]


我已经解决了,我给了表格的最小高度,它的工作原理:)

i am facing a problem, i have searching page after the search button click if a single result has found the content place holder becomes too short that footer of my page is come middle of the page. is it possible to fix minimum height for content placeholder and maximum unlimited.

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <form id="form1" runat="server">
    <table width="100%" style="height: 100px">
        <tr>
            <td>
                <h3 style="margin-left: 23px;">
                    Results</h3>
            </td>
        </tr>
    </table>
    <div id="noresults" runat="server" align="center" style="width:100%;">
    </div>
    <asp:GridView ID="grdView" runat="server" AutoGenerateColumns="False" CssClass="grd"

        CellPadding="0" AllowPaging="true" ForeColor="#333333" GridLines="None" OnRowDataBound="grdView_RowDataBound"

        DataKeyNames="Id" OnRowCommand="grdView_RowCommand" Width="90%" OnPageIndexChanging="grdView_PageIndexChanging">
        <AlternatingRowStyle CssClass="AlternateRowStyle" />
        <FooterStyle BackColor="#C3FDB8" Font-Bold="True" ForeColor="#212121" />
        <RowStyle BackColor="#FFFFFF" ForeColor="#333333" CssClass="RowStyle" />
        <PagerStyle BackColor="#E5E2E2" ForeColor="#212121" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#41F738" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle Font-Bold="True" ForeColor="#212121" HorizontalAlign="Left" Width="150px" />
        <EditRowStyle BackColor="#999999" />
        <%-- <AlternatingRowStyle BackColor="White" ForeColor="#333333" />--%>
        <Columns>
            <asp:TemplateField ItemStyle-Width="70px">
                <ItemTemplate>
                    <asp:Panel ID="pan" runat="server" CssClass="temp">
                        <%# Container.DataItemIndex+1 %><b />
                    </asp:Panel>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <b>
                        <asp:Label ID="lblQuestion" runat="server" Text='<%# Bind("Question") %>'>


                        </asp:Label></b><br />
                    <asp:Label ID="lblDescription" runat="server" Text='<%# Bind("Description") %>'>

                    </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <%--     <asp:TemplateField>
                <ItemTemplate>
                 <asp:Label ID="lblDescription" runat="server" Text='<%# Bind("Description") %>'>

                </asp:Label>
               </ItemTemplate>
              </asp:TemplateField>--%>
            <asp:TemplateField ItemStyle-Width="140px">
                <ItemTemplate>
                    <asp:Panel ID="panel" runat="server" CssClass="panel2">
                        Posted By
                        <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:Label>
                        <br />
                        <%--  <asp:Label ID="lblNoofReply" runat="server" Text='<%# Bind("NoOfReply") %>'></asp:Label>
                        --%>
                        <asp:LinkButton ID="btnNoOfReply" runat="server" Text='<%# Eval("NoOfReply") %>'

                            CommandArgument='<%# Eval("Id") %>' CommandName="Select"></asp:LinkButton>
                    </asp:Panel>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    </form>
</asp:Content>

解决方案

The ContentPlaceHolder will always "resize" to accommodate for other elements around and within it. That's because the ContentPlaceHolder is not a visual control; that is, it doesn't produce any markup in the final HTML. It's just a marker region to add other content to.

If you want to build things at a fixed size, give (CSS) dimensions to the elements around and within the placeholder.

Reference[^]


visit here...

http://forums.asp.net/t/1081037.aspx[^]

or

http://www.sitefinity.com/developer-network/forums/bugs-issues-/bug-empty-placeholder-with-min-height-not-dropable-4-2-1650[^]


i have solved, i gave min-height to the form and it's works :)


这篇关于是否可以确定内容占位符的最小高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆