Wednesday, June 4, 2014

SharePoint: Show Application page as ‘popup’ when an item(Custom Action) clicked from Document set’s ECB(Edit control block).

Context: The requirement of the customer was to make an option available in the edit control block of the document set from where a specific word document will be generated.

Solution: To accomplish that I had to write the server side code (C#.Net) using an application page. I had to read a word document using OpenXml sdk and further create a new document in the document set via C#.Net. The solution that I proposed is to add a new custom action in the edit control block of a document set. I passed the important information such as ListId, ItemId in the query string while calling the application page. When the user clicks a particular item in the EDC of a document set, an application page will be called and server side (C#.Net) code written will be executed.


 The following snapshots will further help you understand what I am talking about;

Once the user click the 'Generate Metadata Document', the server side code will be executed and the application page will be shown as popup window.




  
    
  


As I want to make the custom action to be part of a document set edit control block(ECD), so I used registrationtype='contenttype' and registrationid='0x0120D520' which is the base document set content type id. The url consist of the application page along with the query string. The querystring is used on the application page to identify the list and the list item using C#.Net.

No comments:

Post a Comment