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">
<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>
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">
<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>
Comment