Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 11th, 2005, 05:01 PM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to braheem Send a message via Yahoo to braheem
Default Visibility Issue

Hi,

I have searchable database that returns the results in a table, the headings for each field are visible before a search query has been entered. I would like the table headings to be invisible till a search has happened. How do I make this possible? In the code below I wanted to make the items in the second table below invisible initially then visible after the submit button has been clicked. Thank you in advance for any suggestions.

braheem

<html>
    <head>
        <title>PCCHNS</title>
    <body>
        <center><img src="PCCHNS.gif"></center>
        <br>
        <br>
        <br>
        <form runat="server" ID="Form1">
            <table align="center" border="0">
                            <tr>
                                <td><b>First Name:</b></td>
                                <td><b>Last Name:</b></td>
                            </tr>

                        <tr>
                            <td>
                                <asp:TextBox id="txtFirstname" runat="server" />
                            </td>



                            <td>
                                <asp:TextBox id="txtLastname" runat="server" />
                            </td>

                            <td>
                                <input type="submit" Value="Find" OnServerClick="Button_Click" runat="server" ID="Submit1"
                                    NAME="Submit1">
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <asp:RegularExpressionValidator id="vFName" ControlToValidate="txtFirstname" ValidationExpression="[a-zA-Z]+"
                                ErrorMessage="Invalid input, try again" runat="server" />
                            </td>

                            <td>
                                <asp:RegularExpressionValidator id="vLName" ControlToValidate="txtLastname" ValidationExpression="[a-zA-Z]+"
                                    ErrorMessage="Invalid input, try again" runat="server" />
                            </td>
                        </tr>


        </table>
</form>

            <div id="divSearch" runat="server">
            <table id="Table1" height="27" align="center" cellSpacing="1" cellPadding="1" width="698"
                border="1">
                <tr>
                    <td>First Name</td>
                    <td>Last Name</td>
                    <td>Extension</td>
                    <td>Title</td>
                </tr>
                <asp:Repeater ID="repeater1" Runat="server">
                    <itemtemplate>
                        <tr>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem, "FName")%>
                            </td>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem, "LName")%>
                            </td>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem, "Extension")%>
                            </td>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem, "Title")%>
                            </td>
                        </tr>
                    </itemtemplate>
                </asp:repeater>
            </table>
        </div>

    </body>
</html>


 
Old July 14th, 2005, 05:20 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Why go thru the manual effort of building the HTML? The DataGrid control does just what you are doing. Once "feature" of it that would help you is that if you don't databind the grid (i.e. *before* your search criteria is entered) then the grid won't render. After you enter the search criteria then bind the grid it will show up.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Codebehind for conditional visibility Nostromo77 ASP.NET 2.0 Basics 4 September 21st, 2008 08:00 PM
problem in calendar visibility premnaath ASP.NET 2.0 Professional 1 November 16th, 2007 09:25 AM
visibility dynamic in report ermy78 Access 2 December 18th, 2006 06:19 PM
Chart Visibility baaul Reporting Services 1 September 28th, 2006 03:53 PM
Procedure visibility rgerald Access VBA 6 December 10th, 2003 05:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.