PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

.NET ASPX Not working

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

  • .NET ASPX Not working

    I'm at the end of my rope and I still cant make the search results appear in my ASPX page. Here is the scenario. Maybe I am missing something. I did set the postback URL in the Advanaced tab to "search-result.aspx"

    folder structure:
    Root = has masterpage.master and search-result.aspx.
    /search = folder with all the search files, search,asp, search_template.html, settings.asp etc.
    1. On the Masterpage.master if have the following form code:
    <input type="text" name="zoom_query" size="18" class="search">&nbsp;
    <input type="button" value="Go" class="search" onClick="window.location='http://www.mysite.com/search-result.aspx?zoom_query=' + this.form.zoom_query.value" >

    2. on the Search-result.aspx I have the following code:
    <%@ Page Language="VB" MasterPageFile="~/Masterpage.master" AutoEventWireup="false" %>
    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="System.Diagnostics" %>

    <asp:Content ID="Meta" ContentPlaceHolderID="MetaTags" Runat="Server">
    <title>Page Title.</title>
    <meta name="description" content="some text here.">
    </asp:Content>

    <asp:Content ID="leftsidebar" ContentPlaceHolderID="leftsidebar" Runat="Server">
    <!-- #include virtual ="~/includes/sidebar-about-us.asp" -->
    </asp:Content>

    <asp:Content ID="rightgraphic" ContentPlaceHolderID="rightgraphic" Runat="Server">
    <img src="images/right-graphic-about-us.gif" width="242" height="242" align="right" />
    </asp:Content>

    <asp:Content ID="rightsidebar" ContentPlaceHolderID="rightsidebar" Runat="Server">
    </asp:Content>

    <asp:Content ID="mainbody" ContentPlaceHolderID="mainbody" Runat="Server">
    <%

    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/search.asp")
    psi.EnvironmentVariables("REQUEST_METHOD") = "GET"
    psi.EnvironmentVariables("QUERY_STRING") = paramStr
    psi.EnvironmentVariables("REMOTE_ADDR") = Request.ServerVariables("REMOTE_ADDR")
    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>

  • #2
    It would help if you can tell us what the behaviour is of the above. That is, what it is doing, and what it isn't doing.

    If the search function is on a website that is accessible over the Internet, then please provide us with a URL (via PM if you prefer).

    One thing that did stand out is that you are referring to the ASP script here:

    psi.FileName = Server.MapPath("search/search.asp")
    The instructions given on our Support pages specifically refer to the CGI function and NOT the ASP script. The method given is for wrapping the CGI only. You may want to re-check the instructions here. Remember that you should setup a working CGI search prior to attempting to embed it in an ASPX page.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Hi - I re-indexed the site using CGI platform and modified the script to reference "search/search.cgi".. But still nothing happens. The link to the site that uses the zoom search is http://www.cetcooilfieldservices.com. The search box is placed on the master page. On the site it can be found on the right side of the page under the image blocks.

      Comment


      • #4
        The basic search function seems to be working. For example
        http://www.cetcooilfieldservices.com/search-result.aspx?zoom_query=oil

        It is just the search form that isn't right.

        I think there are a few problem with your code.
        1) You included /new/ in the path to your search funtion.
        www.cetcooilfieldservices.com/new/search-result.aspx
        But this just appears to be a broken link when you include the /new/ sub-folder.

        2) The Javascript you are using for your form fails.
        In FireFox: Error: this.form has no properties
        In IE: Error: Object required

        Comment


        • #5
          I noticed your Javascript form is based on the one in our FAQ here. But your site does not seem to have the "all encompassing <form> tag" as described in the above link. So it may not apply in this case.

          You might want to try the standard HTML form from here instead. Make sure to get the "action" value correct as pointed out in the above post.
          --Ray
          Wrensoft Web Software
          Sydney, Australia
          Zoom Search Engine

          Comment


          • #6
            Thanks!

            I fixed that link.. and added form tags. Although ASPX pages are already encompased in a form tag I added them anyway. It seemed to do the trick.
            http://www.cetcooilfieldservices.com

            Thank you for your help!

            Anita

            Comment

            Working...
            X