c# - set page height -
i've got search page has criteria in panel, when page opens there no results , page footer appearing directly beneath search panel. how set results panel set height, stretch height of grid when search results found. cheers
<%@ page title="" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="frmsearch.aspx.cs" inherits="web.frmsearch" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="asp" %> <asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server"> <asp:toolkitscriptmanager id="toolkitscriptmanager1" runat="server"> </asp:toolkitscriptmanager> <asp:updatepanel id="pnlupdate" runat="server" childrenastriggers="true"> <contenttemplate> <div id="divsearch"> <asp:panel id="pnlsearch" runat="server" defaultbutton="btnsearch"> <table width="100%"> <tr> <td> <asp:label id="lblname" runat="server" text="name:" cssclass="head2"></asp:label> </td> <td> <asp:textbox id="txtsurname" runat="server" width="200" cssclass="norm"></asp:textbox> </td> <tr> <td> <asp:label id="lbladdress" runat="server" text="address:" cssclass="head2"></asp:label> </td> <td> <asp:textbox id="txtaddress" runat="server" width="200" cssclass="norm"></asp:textbox> </td> </tr> <tr> <td colspan="2" align="center"> <asp:button id="btnsearch" runat="server" text="search" onclick="btnsearch_click" /> </td> <td colspan="2" align="center"> <asp:button id="btnreset" runat="server" text="reset" onclick="btnreset_click" /> </td> </tr> </table> </asp:panel> </div> <div> <asp:label id="lblcount" runat="server" cssclass="head2"></asp:label> </div> <hr /> <div id="divresults"> <asp:panel id="pnlresults" runat="server"> <asp:gridview id="gvresults" runat="server" autogeneratecolumns="false" width="99%" cssclass="grd" onrowdatabound="gvresults_rowdatabound"> <columns> <asp:templatefield headertext="name"> <itemtemplate> <asp:hiddenfield id="hfguid" runat="server" value='<%# bind("guid")%>' /> <asp:label id="lblname" runat="server" text='<%# bind("name") %>'></asp:label> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="address"> <itemtemplate> <asp:label id="lbladdress" runat="server" text='<%# bind("address") %>'></asp:label> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="post code"> <itemtemplate> <asp:label id="lblpostcode" runat="server" text='<%# bind("post_code") %>'></asp:label> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="telephone"> <itemstyle width="150px" /> <itemtemplate> <asp:label id="lbltelephone" runat="server" width="150px" text='<%# bind("telephone") %>'></asp:label> </itemtemplate> </asp:templatefield> </columns> </asp:gridview> </asp:panel> </div> </contenttemplate> <triggers> <asp:asyncpostbacktrigger controlid="btnsearch" /> <asp:asyncpostbacktrigger controlid="btnreset" /> </triggers> </asp:updatepanel> </asp:content>
you can use min-height:200px
divsearch
container.
#divsearch { min-height:200px //according requirement }
Comments
Post a Comment