Create a new SharePoint empty project. Create a hierarchy in that like below.
Element.XMl
Code Snippet
- <?xml version="1.0" encoding="utf-8" ?>
- <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
- <CustomAction
- Id="{B08087EF-B682-4fb4-870B-A7CC3F1FDF0B}"
- Title="Slide Reorder"
- RegistrationType="List"
- GroupId="ActionsMenu"
- Location="Microsoft.SharePoint.StandardMenu"
- Sequence="1000"
- RegistrationId="2100"
- Rights="EditListItems"
- ControlAssembly="GMISlideLibraryFeature,Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5"
- ControlClass="GMISlideLibraryFeature.SlideReorderAction">
- </CustomAction>
- </Elements>
Code Snippet
- class SlideReorderAction : WebControl
- {
- private MenuItemTemplate _MenuTemplate;
- protected override void OnLoad(EventArgs e)
- {
- EnsureChildControls();
- base.OnLoad(e);
- }
- protected override void CreateChildControls()
- {
- base.CreateChildControls();
- ListViewWebPart oListView = FindListView(Parent);
- if (oListView == null) return;
- {
- SPWeb site = SPContext.Current.Web;
- site.AllowUnsafeUpdates = true;
- _MenuTemplate = new MenuItemTemplate
- {
- Text = "Slide Reorder",
- Description = "This feature allows Site Owners to add a Change Order menu item to the Slide Library",
- ImageUrl = "/_layouts/images/NEWITEM.GIF",
- ClientOnClickNavigateUrl = "javascript:window.location= '" + site.Url + "/_layouts/GMISlideReorder/SlideReorder.aspx?List=" + oListView.ListName + "&Source=' + window.location"
- };
- this.Controls.Add(_MenuTemplate);
- }
- }
- private ListViewWebPart FindListView(Control oParent)
- {
- if (oParent is ListViewWebPart) return (ListViewWebPart)oParent;
- if (oParent.Parent == null) return null;
- return FindListView(oParent.Parent);
- }
- \
Nice post about SharePoint.
ReplyDeleteWith the growth of companies, SharePoint is emerging at a rapid speed each day.
Thanks.
joykernel