Posts

Showing posts from March, 2012

Get current SharePoint site URL port number

Uri uri = new Uri ( "http://Site:80/SitePages/AllItems.aspx" ); string requested = uri.Scheme + Uri .SchemeDelimiter + uri.Host + ":" + uri.Port;

Create custom menu Under Site Settings page in SharePoint 2010

< CustomAction       Id = " SiteCollectionAdministrators "       GroupId = " UsersAndPermissions "       Location = " Microsoft.SharePoint.SiteSettings "       RequireSiteAdministrator = " FALSE "       Sequence = " 10 "       ImageUrl = " /_layouts/images/accesssetting.gif "       Title = " Custom Menu Action " >     < UrlAction Url = " _layouts/AddCustomMenuInLstSet/HelloWorld.aspx " />   </ CustomAction >

Create custom menu under Site Actions in SharePoint 2010

  < CustomAction        Id = " SiteActionsToolbar "        GroupId = " SiteActions "        Location = " Microsoft.SharePoint.StandardMenu "        RequireSiteAdministrator = " FALSE "        Sequence = " 2001 "        ImageUrl = " /_layouts/images/accesssetting.gif "        Title = " Custom Site Action " >     < UrlAction Url = " _layouts/Testfolder/Test.aspx?List={ListId} " />   </ CustomAction >

Create Custom Ribbon and Open an Application page in Model Popup using that custom Ribbon in SharePoint 2010

< CustomAction    Id = " DemoHelloWorldButton "    RegistrationType = " List "    RegistrationId = " 101 "    Location = " CommandUI.Ribbon " >     < CommandUIExtension >       < CommandUIDefinitions >         < CommandUIDefinition          Location = " Ribbon.Documents.New.Controls._children " >           < Button            Id = " Ribbon.Documents.New.Controls.DemoHelloWorldButton "            Alt = " My own Ribbon "            Sequence = " 10 "            Image32by32 = " /_LAYOUTS/imagesCANGKL7U.jpg "            Command = " Demo_HelloWorld "            LabelText = " My Own Ribbon "            TemplateAlias = " o2 " />         </ CommandUIDefinition >       </ CommandUIDefinitions >       < CommandUIHandlers >         < CommandUIHandler Command = " Demo_HelloWorld &qu

Creating custom menu with Popup

<? xml version = " 1.0 " encoding = " utf-8 " ?> < Elements xmlns = " http://schemas.microsoft.com/sharepoint/ " >   < CustomAction Id = " SiteActionsToolbar "        GroupId = " PersonalActions "        Location = " Microsoft.SharePoint.StandardMenu "        Sequence = " 1050 "                        Title = " Change Password "        Description = " Change the Password "        ImageUrl = " /_layouts/IMAGES/picture.jpg " >        < UrlAction Url = " javascript:OpenPopUpPageWithTitle('{SiteUrl}/_layouts/Testfolder/Test.aspx', RefreshOnDialogClose, 600, 300,'Change Password') " />   </ CustomAction >   </ Elements >