Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • vaibhav 119 posts 139 karma points
    Jul 15, 2011 @ 09:39
    vaibhav
    0

    Search results problem

    Hello,

    i have two websites in my content like this..

    Content

    >>Web1

    >>Web2

    I am using same user control for both the sites which has search text box & a button.

    User Control redirects to the Results.aspx page....

    var searchTerm = searchTextTop.Text.Trim();
    Response.Redirect(string.Format("~/Results.aspx?s={0}", searchTerm));

    Both the webs has a Results.aspx page inside it.

    When i search in any of sites it redirects to the Results.aspx page of 1st site only ......which is not expected.....

    what to do to avoide this ....

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Jul 15, 2011 @ 10:19
    Michael Latouche
    0

    Hello,

    I am not 100% sure, but I think that if you have duplicate file names in the structure, it will use the first one it finds. Maybe you can try by using different page names to see if that is the issue?

    If it is, then maybe you can turn your user control into a macro with a property "SearchResult" of type content picker, so that in site 1, you can point explicitely to the search result page 1, and in site 2 to the search result page 2. And in your code behind in can then redirect to the correct page.

    Hope this helps.

    Cheers,

    Michael.

     

  • vaibhav 119 posts 139 karma points
    Jul 15, 2011 @ 11:32
    vaibhav
    0

    Thnax for reply ....

    I really dident understood that what you wnt to say .....

    my Results.aspx calls ons xslt which finds the matches & displayes the results ......

    Can u explain it in more details plz so that i can do changes according to that ....

  • vaibhav 119 posts 139 karma points
    Jul 15, 2011 @ 11:37
    vaibhav
    0

    Thnax for reply ....

    I really dident understood that what you wnt to say .....

    my Results.aspx calls ons xslt which finds the matches & displayes the results ......

    Can u explain it in more details plz so that i can do changes according to that ....

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Jul 15, 2011 @ 13:29
    Michael Latouche
    0

    Hello,

    Now that I think of it, the issue might be simpler. Have you defined hostnames on your web roots?

    Also, you need to change the following line in the umbracoSettings.config file in the config folder to true.

    <useDomainPrefixes>false</useDomainPrefixes>

    Hope this helps.

    Michael.

  • vaibhav 119 posts 139 karma points
    Jul 15, 2011 @ 16:12
    vaibhav
    0

    I have not defined hostnames yet ....is that will solve this problem ??

    I changed useDomainPrefixes to true but the problem is same ...

  • Asif Malik 203 posts 339 karma points
    Jul 19, 2011 @ 09:48
    Asif Malik
    0

    Hi

    If you define the hostnames this should correct the problem, basically both of your results.aspx files have the same URL, and so it will always go to the first one. Once you define the hsotnames for both your websites it should give them extra URLs and this should fix the problem.

     

    Hope this helps

Please Sign in or register to post replies

Write your reply to:

Draft