Tuesday 5 March 2013

Using Modules to Include Files in the Solution

I have seen lots of people struggle with Modules. Sometimes modules are getting deployed successfully but files are not reflecting in Document library.


First of all the Element.xml file should have below structure.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <Module Name="MyCustomModule" Url="SitePages" Path="MyCustomModule">
    <File Url="Sample.aspx" Type="GhostableInLibrary"/>
  </Module>
</Elements>

In above XML few things need to be taken care.

Url ( In Module element): Url in module element indicates the URL of the library where files need be created.

Url (In File element) : The location where the file will be deployed on the SharePoint server

Type: It indicates that whether file is available in Document library as a Item. If this attribute is missing, file would be available under list/libraries but it won’t show up in any of the Views.

1 comment:

milecar said...

Thanks for the useful information about Web Design.
Airelon not only creates aesthetically Professional Web Design Orange County, but we incorporate your company’s brand and mix it with the proper use of images, color, structure and functionality to stimulate visitors and make them go deeper into the website.Our team strives to make your business website design the best and we work diligently with you to deliver a complete business solution that achieves your goals, empowers your brand, and generates business.

Query List/Document Library in Specific Folder

To query SharePoint List or Document Library in specific Folder “ FolderServerRelativeUrl ” as part of the CAML Query Code Snippet ...