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 am trying to deploy custom pages from feature. I came to know that the webparts(oob or custom) are to be deployed from the elements file using the "AllUserWebPart" wherein we have to include the ".webpart" or ".dwp" file of the webpart on our page(if you export the webpart you can have its .webpart file). However once i deploy my feature and activate it, the pages get deployed with the webpart. But the custom view which i attached to my xsltlistview before extracting is changed and set back to the default view of the list.

I need help in fixing the rendering of correct list view with the webpart.

share|improve this question

1 Answer 1

Unfortunately, the custom view that you created is not expored with the XSLTListView web part. This is why it is resetting to the default view.

The only solution I've found to this was to include my view in the list definition of the list I was going to create an XSLTListViewWebPart for, and then I could point my XSLTListViewWebPart at that view using the BaseViewID.

I'd also expect to put this in a "View" tag, not an "AllUserWebPart" tag - something like:

<View List="303" BaseViewID="0" WebPartZoneID="BlogNavigator" WebPartOrder="1"> 
<![CDATA[ 
    <webParts> 
        <webPart xmlns="http://schemas.microsoft.com/WebPart/v3"> 
        <metaData> 
            <type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" /> 
            <importErrorMessage>Cannot import this Web Part.</importErrorMessage> 
        </metaData> 
        <data> 
        <properties> 
            <property name="ChromeType" type="chrometype">None</property> 
        </properties> 
        </data> 
        </webPart> 
    </webParts> 
]]>
</View>
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.