Use DelegateControl to implement webpart development, deployment, and feature control management

Source: Internet
Author: User

Use DelegateControl to implement webpart development, deployment, and feature control management

I. design phase.

1. Create a project named workflowMenu and create a user control wf_workflowMenu.ascx to complete control development.

2. Create a feature file. Create a folder named workflowMenu in the project, and create two xml files, feature. xml and Control. xml. The Code is as follows:

Feature. xml

 

<? Xml version = "1.0" encoding = "UTF-8"?>
<Feature Id = "00bfea71-2062-417c-90bf-714c59600178"
Title = "process navigation menu control"
Description = "process navigation menu control"
Version = "1.0.0.0"
Scope = "Farm"
Xmlns = "http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location = "Control. xml"/>
</ElementManifests>
</Feature>

 

Control. xml

<? Xml version = "1.0" encoding = "UTF-8"?>
<Elements xmlns = "http://schemas.microsoft.com/sharepoint/">
<Control Id = "workflowMenuId" ControlSrc = "~ /_ ControlTemplates/workflowMenu/wf_workflowMenu.ascx "Sequence =" 100 ">
</Control>
</Elements>

This completes the file design.

Ii. deployment phase.

1. Place the user control in the C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ CONTROLTEMPLATES \ directory,

For example, C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ CONTROLTEMPLATES \ workflowMenu \ wf_workflowMenu.ascx

2. Copy the workflowmenu folder in the project to the C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES directory,

File: C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES \ workflowMenu \ feature. xml

C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES \ workflowMenu \ Control. xml

 

 

3. Install Feature. Use stsadm to install Feature as follows:

Install feature: stsadm-o installfeature-filename workflowMenu \ feature. xm

Activate feature: stsadm-o activatefeature-name workflowMenu

Iisreset

4. Apply the user control developed on the page or page template. For example, modify the masterpage file of the site and add the following code to the location where you want to place the control:

 

<Asp: ContentPlaceHolder ID = "PlaceHolderworkflowMenu" runat = "server">
<SharePoint: DelegateControl runat = "server" ControlId = "workflowMenuId">
</SharePoint: DelegateControl>
</Asp: ContentPlaceHolder>

3. view the results. The process menu just designed is displayed on the sharepoint webpage, for example:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.