Add list view webpart in site definition onet.xml

Here is how you add a List View Web Part in onet.xml of your site definition.

<Module Name="Reports" Url="" Path="">
<File Url="Report.aspx" NavBarHome="False">
<View List="12001" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="1">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, …</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart
</TypeName>
<Title>ListName</Title> -> Add the List Name
<FrameType>TitleBarOnly</FrameType>
</WebPart>
]]>
</View>
</File>
</Module>

0 comments:

Post a Comment

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at sharepointprogrammingblogger@gmail.com .

Copyright (c) 2010 @ myshaepointwork.blogspot.com. All rights are reserved.Do Not Copy.

@ Learning SharePoint.com