Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Search Form with results on a different page

Results 1 to 3 of 3
Share This Thread →
  1. #1
    AntoMadman is offline Registered User
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Search Form with results on a different page

    Hi Guys!

    I a new to asp and I am looking for a little bit of help with the last part of a project. I have redesigned a site for a client and he wanted to have a search form on a the home page then have the results in a new page. I am not sure if this is possible with existing form that is in the site. Once I separate the results and the form I get errors. I'm sorry if this is a stupid question but any help would be greatly appreciated. Here is the code of the existing form that I have.

    Code:
     
    <asp:Panel ID="advSearchOptions" runat ="server">
    <table class="form" style="margin:0; padding:0; color:#fff">
    <tr>
          <th colspan ="2">
          <asp:Literal ID ="litInit" runat ="server"></asp:Literal>         
          </th>
    </tr>
    <tr>
          <td colspan="2">Keywords:</td>
    </tr>
    <tr>
          <td>
          <asp:TextBox ID="TextBoxKeywords" runat ="server" MaxLength="32"></asp:TextBox>
          </td>
    </tr>
    <tr>
          <td colspan="2">Location:</td>
    </tr>
          <td>
          <asp:DropDownList ID="DropDownLocation" runat ="server"> </asp:DropDownList>
          </td>
    <tr>
          <td colspan="2">Disciplines:</td>
    </tr>
    <tr>
          <td>
          <asp:DropDownList ID="DropDownListDisciplines" runat ="server"></asp:DropDownList>
           </td>
    </tr>
    <tr>
          <td>
    <asp:Button ID="ButtonSubmit" OnClientClick="javascript:top.location = 'searchresults.aspx';return true;"  CssClass="button"  runat ="server" Text ="Search" />
    </td>
                
                </tr>
                    <td>Employment Type:</td>
                    <td>
                        <asp:DropDownList ID="DropDownEmployementType" runat ="server"></asp:DropDownList>
                    </td>
                    <td></td>
                    
                </tr>
                <tr>
                    <td>Salary Min:</td>
                    <td><asp:DropDownList ID="DropDownSalaryMin" runat ="server">
                        
                    </asp:DropDownList></td>
                    <td></td>
                    <td>Salary Max:</td>
                    <td><asp:DropDownList ID="DropDownSalaryMax" runat ="server"></asp:DropDownList></td>
                    <td></td>
                </tr>
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
    				<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    
    				<td>&nbsp;</td>
                    
                </tr>
            </table>
        </asp:Panel>  
     <asp:Panel ID="advSearchResults" runat ="server">
            <h1>Search Results</h1>
           
            
            <asp:datagrid id="dgSearchResults" runat="server" gridlines="None"
            showheader="False" autogeneratecolumns="False" datakeyfield="Job_rID"
            pagesize="50" AllowPaging="True">
    					<Columns>
    						<asp:TemplateColumn SortExpression="Title" HeaderText="Title">
    							<ItemTemplate>
                                    <h2><%#DataBinder.Eval(Container.DataItem, "job_title")%></h2>
                                    <div class="overview"><p><span>Location:</span> <%#GetLocation(DataBinder.Eval(Container.DataItem, "job_locationid"))%></p>
                                    <p><span>Salary:</span> <%#DataBinder.Eval(Container.DataItem, "salary", "{0:N0}")%> </p>
                                    <p><span>Ref:</span> <%#DataBinder.Eval(Container.DataItem, "job_reference")%> </p>
                                    <p><span>Type:</span> <%#GetEmploymentType(DataBinder.Eval(Container.DataItem, "job_typeid"))%></p></div>
                                    <div class="summary"><p><%#DataBinder.Eval(Container.DataItem, "job_description")%> </p></div>
                                    <div class="more_details"><a href="Jobdetails.aspx?ID=<%#DataBinder.Eval(Container.DataItem, "job_rid")%>">more details</a></div>
                                      <br style="clear:both"/><br /><br />
                                </ItemTemplate>
                           
    						</asp:TemplateColumn>
    					</Columns>
    					<PagerStyle CssClass="PagingLinks" Mode="NumericPages"></PagerStyle>
    				</asp:datagrid>
            <asp:Label ID="lblNoSearchResults" runat ="server" ForeColor ="red" ></asp:Label>
            <br />
        </asp:Panel>
        </asp:Panel>
    Thanks

  2. #2
    Shadow Wizard's Avatar
    Shadow Wizard is offline Moderator From Beyond
    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,126
    Rep Power
    2921
    --moved to the .NET forum, ASP forum is for classic ASP only.

  3. #3
    jmurrayhead is offline Moderator
    Join Date
    Feb 2004
    Location
    Reston, VA
    Posts
    13,248
    Rep Power
    1907
    The link here discusses using either the PostBackUrl Property or using QueryString to send results to a different results page
    jmurrayhead

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Problem with search page results.
    By alanh in forum ASP Development
    Replies: 1
    Last Post: November 17th, 2005, 03:57 PM
  2. Replies: 3
    Last Post: November 15th, 2005, 03:50 PM
  3. Replies: 0
    Last Post: May 31st, 2004, 06:56 AM
  4. Passing some form variables to some other .NET page
    By nasir ahmed in forum .NET Development
    Replies: 3
    Last Post: November 20th, 2003, 04:06 AM
  5. Replies: 0
    Last Post: April 3rd, 2002, 10:24 AM

ASP Free Advertisers and Affiliates