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: