Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.