You can add a custom menu item for an entry control block to a list item or a document in Microsoft Windows SharePoint Services 3.0 by creating a Feature with a CustomAction element. In this way, you can add custom commands to the default SharePoint user interface. These menu commands allow users to perform custom operations on items and documents. For example, you can create a custom menu item for an entry control block for a list item or document that redirects the user to a custom application page. So, lets get started.
Save it and Select F5. The VS 2010 will deploy your solution and then it will open up the debugging sites default home page. Go to any of the Document Library and select any record, open its ECB Menu and Here comes your custom ECB Menu Item:
If you select this custom menu item, you will be redirected to the url you have specified in your Element.XML file. So, very easily you can redirect user to your applications custom page also!
Here certain things you need to know. In SP, everything has some ID associated with it. So, the registration ID specifies in which categories Edit Control Block, you want your custom menu to appear. The complete list of Registration ID in respect to SP 2010 can be found from Mike Smith’s blog post.
If you want to know about the different attributes present in the Custom Action Element, select the following url:
CustomAction Element in depth from MSDN.
Now, here comes another very interesting tricks: Sometimes in real life project the requirement will be to add Custom ECB Menu Item to SPecific List/ Libraries. How to do that? The answer is very simple, whenever you create any list/ library through feature, you provide some unique Template ID in that xml. Copy that ID and place it as your Registration ID. Bang! You are done.