Search Engine!

Discussion in 'ASP.NET 2.0' started by Dan Nguyen, Jan 18, 2007.

  1. Hi,
    I have created a search engine in my website www.nailsvl.com and it's working fine when I test on my local, however, when I upload to discountasp server, the search engine stop working :)

    When I executed a search engine at my local the url look like this http://localhost:3039/BeautyShop/Search.aspx?Search=test&AllWords=True

    However, When I executed a search engine from discountasp server url displays http://www.nailsvl.com/Default.aspxand show The page cannot be displayed

    Below is a code when clicking the search button.

    Hopefully, someone can find out erros.
    Thanks
    Danny




    protected void goButton_Click(object sender, EventArgs e)


    {


    ExecuteSearch();


    }


    // Redirect to the search results page


    private void ExecuteSearch()


    {


    if (searchTextBox.Text.Trim() != "")


    Response.Redirect(Request.ApplicationPath+ "/Search.aspx?Search=" + searchTextBox.Text +


    "&AllWords=" + allWordsCheckBox.Checked.ToString());


    }
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    I think the problem is has to do w/ an invalid value in the applicationPath

    Response.Redirect(Request.ApplicationPath+ "/Search.aspx?Search=" + searchTextBox.Text + "&AllWords=" + allWordsCheckBox.Checked.ToString());


    I checked the page it's trying to redirect to, it shows http://search.aspx/?Search=fds&AllWords=False


    which, of course, is invalid.


    I found this article on the net which may help


    http://weblogs.asp.net/dneimke/archive/2004/05/17/133116.aspx

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Hi Bruce,
    Thanks for your quick response........as recomment from that website 'The easiest way is to simply add all of your pages under a sub-folder'
    Luckly, I still develop my website, so I can change it easily. Let me try that...
    Thanks for your time
    Danny
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    If your search page is in the root, why don't you just remove ApplicationPath

    like

    Response.Redirect("/Search.aspx?Search=" + searchTextBox.Text +"&AllWords=" + allWordsCheckBox.Checked.ToString());

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. I have removed it


    private void ExecuteSearch()


    {


    if (searchTextBox.Text.Trim() != "")


    Response.Redirect("/Search.aspx?Search=" + searchTextBox.Text + "&AllWords=" + allWordsCheckBox.Checked.ToString());


    }



    However, It still has errors. :)
     
  6. Please disregarding the post above........I figure out to fix that problem now.
    It's working now.....
    THanks for your help Bruce
    Danny
     
  7. Danny,

    You asked a question in one of your posts about how to make "default.aspx" the default page if is folder path is requested.

    To do this open your IIS manager (start > run > inetmgr) Then either right click your default website or the virtual directory you are using, and select properties.
    When this open one of the tabs is "Documents", choose that one. Then you'll be able to add/remove documents in the default list and make sure the check box for "enable default documents is checked".
     

Share This Page