0

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.

1 Answer 1

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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