Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

is it possible to use sharepoint server-side code inside the search core web part xstl? I have to join the search web part data and data from a custom list.

I am trying to achieve this functionality:

enter image description here

share|improve this question

2 Answers 2

You can't use server side code inside the xslt. The only way to achieve your goal is by extending the core search web part.

By extending the core search results web part you can take control over the query (using server side code) and make your own query or just append your query using FQL (Fast Query Language) or keyword query. This way you can join the search web part data and data from a custom list.

Example:

   [ToolboxItemAttribute(false)]
    public class JoinListsCoreResultWebPart : CoreResultsWebPart
    {
protected override void ConfigureDataSourceProperties()
        {
        //Just Append Search Query with your query
            this.AppendedQuery = "your join query for custom list";

            base.ConfigureDataSourceProperties();
        }
    }
}

Check out this post: http://sqlgoogler.blogspot.co.il/2012/01/extend-search-core-result-web-part-with.html

And this one: http://consultingblogs.emc.com/mattlally/archive/2011/12/29/sharepoint-2010-custom-my-search-core-results.aspx

share|improve this answer
    
Hi Alex, thanks a lot for your help. I will try your suggestion. I will be back soon. –  Helm Ifort Apr 17 '13 at 7:48
    
have you tried this solution? –  Alex Choroshin Apr 21 '13 at 17:16
1  
Hi Alex, I gave it a try but it seemed difficult to achieve it. I found another solution though that helped me. I created an xslt function and I used that in my search result web part. Thanks a lot though for your help. –  Helm Ifort Apr 22 '13 at 8:15

For anyone who might fase the same issue this is how I solved it:

I created a xslt function. I used this link create-your-own-xslt-functions-using-c. it is a long blog that is why I am not pasting any code here. However, if you need help let me know. I hope it helps someone else.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.