SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

does anyone know how to show the new list element form on button click, that I have on my custom aspx page? Like when you have a sharepoint list and you click on "add item" and a new element form loads up in a new dialog window? I need the same thing to happen when I click on my button. I know how to do that in Sharepoint Designer, but I need to do it programmatically in visual studio. I assume Javascript must be involved in some way and I am terrible with it. Thaks in advance!

share|improve this question
up vote 2 down vote accepted

In SharePoint 2010(I think aslo in the previuos versions) using IE developer toolbar You can read the javascript assigned to the onClick attribute of the "Add new Item" button and then create Your own button with the same onClick method.

Update: Open IE developertool bar -> click on the arrow in the top left corner of IE developer toolbar -> select the "Add new item" button on the desired list -> read the onClick javascript

enter image description here

share|improve this answer
Thanks for the reply, zavaz. Coould you elaborate where exactly I can find it? I opened IE developer toolbar, but can't find where exactly this onClick method is – Alex Aug 12 '11 at 8:57
Thank you, now I found it. – Alex Aug 12 '11 at 9:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.