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

I have created a custom Search results web part by inheriting from coreresultswebpart. I would like to override the default XSL with some modified XSL in my project instead of having to set the XSL using the web part properties on the site.

I have already added a few custom properties to my custom webpart and found a msdn article discussing the DataFormWebPart.Xsl Property. Just not sure how to take my modified XSL and set it to that property.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

In your webpart constructor just set the property there.

public MyCustomWebpart()
{
     this.Xsl = "<xml></xml>";
}
share|improve this answer
    
Thanks Steve, this worked great. –  Jason Jones Apr 27 '12 at 17:52

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.