欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

Deploying files using Mapped Folders

系統(tǒng) 1661 0

With Visual Studio 2010 SharePoint Developer Tools, the concept of the Mapped Folder was introduced. A mapped folder is a convenient way for developers to specify a location for any files that need to be deployed on to the SharePoint file system, all from within in a Visual Studio solution. Mapped folders can be included as part of a deployment package (.WSP) and the files will get copied to the correct location when the WSP is installed on to the server.

Let’s take a quick look at how a developer might use a mapped folder. Say a developer wants to develop a custom application page for their SharePoint site that will consume a custom image. The SharePoint server has a designated location for both application pages and images. With mapped folders, the developer can ensure that their files will be deployed to the correct location. Here’s an example:

First we need to create a project. In this example, we will start by creating an Empty SharePoint project (Installed Templates->Visual Basic/C#->SharePoint->2010).

Deploying files using Mapped Folders

Next, we’ll create our custom image that we want to display. First, let’s setup a mapped folder to the Images directory on the SharePoint farm. To do this, we simply right-click on the project node and select “Add->SharePoint “Images” Mapped Folder”:

Deploying files using Mapped Folders

This will create a mapped folder named “Images” in our project. (You can also create it via the “Project->Add SharePoint “Images” Mapped Folder on the main menu bar”)

In the Solution Explorer, mapped folders look very similar to normal folders but have a small green globe in the bottom right corner of the icon. You’ll notice that underneath the mapped folder there is a sub folder with the same name as the project. This is to help organize images specific to your project and keep developers from inadvertently overwriting another item with the same name.

Deploying files using Mapped Folders

Also, if you select the mapped folder and open the property window (F4), you’ll see two entries: Folder Name and Deployment Location. The Deployment Location indicates the location relative to the SharePoint root directory ({SharePointRoot}) on the SharePoint farm.

Deploying files using Mapped Folders

Now that we have our mapped folder, we can right-click on the project directory underneath it and add our image file (“Add->New Item’). In this example, I’ve added a bitmap image named ”Bob.bmp”.

The next step is to create the application page and modify it to show our image. To start, right-click on the project node in the Solution Explorer and select “Add->New Item”. When the Add New Item dialog appears, the “2010” node under SharePoint will be selected. From the list of templates, select the “Application Page” item, give it the name you want, and click “Add”. You’ll notice that when the application page is added to the project, it automatically gets created under the “Layouts” mapped folder, which is the default location on the SharePoint file system for application pages:

Deploying files using Mapped Folders

Following its creation, the .aspx file we just added should be opened in the designer. Locate the <asp:Content> element with the ID equal to “Main”. Within that element add an image element and set the ImageUrl attribute to point to the image in your product. It should look like this:

    
      <
    
    
      asp:Content
    
    
      ID
    
    
      ="Main"
    
    
      ContentPlaceHolderID
    
    
      ="PlaceHolderMain"
    
    
      runat
    
    
      ="server"
    
    
      >
    
    
      <
    
    
      asp:Label
    
    
      ID
    
    
      ="Label1"
    
    
      runat
    
    
      ="server"
    
    
      Text
    
    
      ="Label"
    
    
      Font-Size
    
    
      ="Medium"
    
    
      >
    
    This is Bob.......
    
      </
    
    
      asp:Label
    
    
      >
    
    
      <
    
    
      asp:Image
    
    
      ID
    
    
      ="Image1"
    
    
      runat
    
    
      ="server"
    
    
      ImageUrl
    
    
      ="~/_layouts/Images/SharePointProject1/Bob.bmp"
    
    
      />
    
    
      </
    
    
      asp:Content
    
    
      >
    
  

The last thing we’ll want to do to make testing our project easier is to set the application page to be our startup item when we F5. To do this, select the project node in the Solution Explorer and open the property window (F4). In the property window, select the “Startup Item” property and choose our application page from the drop down list. Now when we F5, it will take us right to our application page:

Deploying files using Mapped Folders

A couple of things to know about mapped folders. First, since mapped folders effectively deploy files onto the SharePoint file system, they are only allowed in farm level solutions. Sandboxed solutions are restricted to only deploying content to the content database on the server. In VS, when you try add a mapped folder to a sandboxed solution, the package validation will generate an error regarding this.

Second, as you saw when we added the application page, some items go into certain mapped folders by default when they are added to the project. Another example is User Control items (.ascx) which are automatically placed into the User Control mapped folder. While these are the SharePoint “default” locations, there may be times you need to place one of these files in a different location, and this can be done by mapping the folder to a different location.

Finally, you can create a mapped folder to any folder under the SharePoint root on the farm by opening the Add SharePoint Mapped Folder dialog (Project->Add SharePoint Mapped Folder… from main menu, Add->SharePoint Mapped Folder… from project context menu :

Deploying files using Mapped Folders

For instance, if you had a custom web service you wanted to deploy to the SharePoint server, you could simply add a mapped folder that points to the ISAPI directory on the SharePoint file system and dropped the web service in there. Then, when the package gets deployed to the server, the web service will automatically be placed in the ISAPI directory and available for consumption.

Deploying files using Mapped Folders


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦?。?!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 青青青国产观看免费视频 | 国产传媒视频 | 日韩在线观看视频免费 | 久久久久久久久日本理论电影 | 国产精品第一页在线 | 欧美淫片 | 九九九色 | 亚洲网站在线观看 | 国产高清精品一区 | 天天做天天添天天谢 | 国产成人91高清精品免费 | 国产精品视频免费观看 | 97精品国产高清久久久久蜜芽 | 泰国一级毛片aaa下面毛多 | 成人亚洲一区二区色情无码潘金莲 | 视频一区二区不卡 | 亚洲精品乱码久久久久久久久久 | 91国在线产 | 久久久久国产成人精品亚洲午夜 | 扒开双腿进入做爰视频 | 米奇777四色精品人人爽 | 激情婷婷成人亚洲综合 | 欧美亚洲第一页 | 国产成人aaa在线视频免费观看 | 欧美一区二三区 | 色综合久久久久久久久五月性色 | 视频一区二区三区四区五区 | 奇米 影音先锋 | 亚洲奇米| 国产成人久久蜜一区二区 | 美乃雀中文字幕在线一区 | 国产成人18黄禁网站免费观看 | 日本高清一区二区三区不卡免费 | 冰封侠:时空行者 | 欧美va亚洲 | 狠狠色噜噜狠狠狠狠黑人 | 欧美一区二区三区gg高清影视 | 欧美jlzz18性欧美 | 欧美激情人成日本在线视频 | 这里只有精品视频 | 人人爱国产 |