PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Problems Setting up an ASPX Search Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems Setting up an ASPX Search Page

    Hi, all. First post here in the forums. I'm not a new Zoom user, actually bought it when it was 2.x back in late 2003, but decided to buy the latest version so I could have ASP.NET capabilities.

    I've thoroughly digested your ASP.NET support page, and followed the instructions to the best of my ability. I'm getting the following error on my search page:

    ASP.NET runtime error: Only Content controls are allowed directly in a content page that contains Content controls.
    Looks like your forum won't let me post attachments, so here's my page code. Any suggestions on how I can fix this will be appreciated. Thanks!

    Code:
    <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Template.Master" CodeBehind="search.aspx.vb" 
        Inherits="techtips_DotNet.search" title="Search My Website" %>
    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="System.Diagnostics" %>
    <%
    
    Dim paramStr As String = "" 
    Dim parampos As Integer = Request.RawUrl.IndexOf("?") 
    If (parampos >= 0) Then 
        paramStr = Request.RawUrl.Substring((parampos + 1)) 
    End If 
    Dim psi As ProcessStartInfo = New ProcessStartInfo 
    psi.FileName = Server.MapPath("search.cgi") 
    psi.EnvironmentVariables("REQUEST_METHOD") = "GET" 
    psi.EnvironmentVariables("QUERY_STRING") = paramStr 
    psi.RedirectStandardInput = false 
    psi.RedirectStandardOutput = true 
    psi.UseShellExecute = false 
    Dim proc As Process = Process.Start(psi) 
    proc.StandardOutput.ReadLine 
    Dim zoom_results As String = proc.StandardOutput.ReadToEnd 
    ' read from stdout 
    proc.WaitForExit 
    ' Print the output 
    Response.Write(zoom_results)
     
    
    %>
    <asp:Content ID="Content1" ContentPlaceHolderID="TemplateContent" runat="server">
    
    <h1 class="title">Search My Website</h1>
    
    <div class="searchfrm">
    <form class="sphiderform" method="get" action="/Search.aspx">
    <div class="searchfrm1">
    Powered By
    <br />
    <a href="http://www.wrensoft.com/">
    <img src="http://www.techtipscentral.net/images/zoom_logo_small.gif" class="no_border"
    alt="Powered by Zoom Search Engine"
    title="Powered by Zoom Search Engine" /></a>
    
    </div>
    <div class="searchfrm2">
    <div class="searchfrm2a">
    Enter Search Criteria
    </div>
    <div class="searchfrm2b">
    <form method="GET" action="search.aspx">
    <input type="text" name="zoom_query" size="40" />
    <input type="submit" value="Search" /><br /><br />
    Results per page:
    <select name="zoom_per_page">
    <option>20</option>
    <option selected="selected">50</option>
    <option >100</option>
    </select>
    <br /><br />
    Match:
    <input type="radio" name="zoom_and" value="0" checked="checked" />
    any search words
    <input type="radio" name="zoom_and" value="1" />
    all search words
    </form>
    </div>
    
    <div class="searchfrm2c">&nbsp;
    </div>
    </div>
    </form>
    </div>
    
    <br /><br />
    	
    <!--ZOOMSEARCH-->
    
    </asp:Content>

  • #2
    You do not need to place the search form HTML or the <!--ZOOMSEARCH--> tag in your ASPX page. The form is automatically generated by the CGI (unless you have changed this behaviour in the config), and the <!--ZOOMSEARCH--> tag should only appear in the "search_template.html" file. So first, try removing these from your ASPX page.

    If you still have trouble getting this to work, you may want to consider beta testing our ASP.NET native control. Send us an e-mail as described in the link above and we will be in contact.
    Last edited by Ray; Jan-09-2008, 11:45 PM.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Ah, yes. I had been playing around with different things trying to solve this problem before posting to the forum. Just for the record, removing the <!--ZOOMSEARCH--> comment line had no effect; I'm still getting the same error on my search page.

      I would very much like to beta test this new search control. I will use that link to contact you.

      Thanks so much for your help!

      Comment


      • #4
        This answer may be quite a bit late, but it case someone falls upon this thread ...

        You're probably missing a Page_Load function in your page.
        Code:
        sub Page_Load(Sender As Object, E As EventArgs)
           ' ... code to call search cgi
        end sub

        Comment

        Working...
        X