Prev: New in VS 2008
Next: Offshore Development Partnership
From: sjsean on 16 Aug 2010 01:07 I have a gridview on a search page. When someone searches I want the view to display a "new" button when either no results are returned or some results are returned. The problem I have currently is the "new" button shows upon initial load of the page and I want to force people to search first. How can I accomplish this? <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" PageSize="5" GridLines="None" HorizontalAlign="Left" ShowHeader="False"> <Columns> <asp:HyperLinkField DataNavigateUrlFields="location_id" DataTextField="location_nickname" DataNavigateUrlFormatString="default5.aspx? location_id={0}" NavigateUrl="~/Default5.aspx"></ asp:HyperLinkField> <asp:TemplateField> <FooterTemplate> <table style="width: 104%"> <tr align="left" > <td> <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="New Spot" /> </td> </tr> </table> </FooterTemplate> </asp:TemplateField> </Columns> <emptydatatemplate> <table style="width: 104%"> <tr align="left" > <td> <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="New Spot" /> </td> </tr> </table> </emptydatatemplate> </asp:GridView>
|
Pages: 1 Prev: New in VS 2008 Next: Offshore Development Partnership |