Click here to Skip to main content
15,905,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

XML
<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>
Posted
Updated 3-Oct-13 1:27am
v3
Comments
Azee 3-Oct-13 7:13am    
Try to set the min-height of the container in which the this perticular Content is placed inside master page.
Mohd Arif Khan 3-Oct-13 7:15am    
i have already tried it. but not worked.
Azee 3-Oct-13 7:24am    
Can you post the code and css?
Mohd Arif Khan 3-Oct-13 7:27am    
ok
Mohd Arif Khan 3-Oct-13 7:29am    
i have tried to give min-height of gridview thru css,but it's not working

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[^]
 
Share this answer
 
i have solved, i gave min-height to the form and it's works :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900