Get current item in custom list form


Hello everyone

In a previous article, I wrote about how to customize list forms.

Today I’ll talk about 3 things about custom forms.

1) How to get the current item                                     

To retrieve the current itemyou have to go through the itemcontext of ListFormWebPart

1

2) Close the form.

At the end of my button click, I used the following three lines to close the popup and refresh the calling page.

2
3) Associate an event to a button

Doing my development, I noticed a strange thing when I tried to add a button.

In my custom page, I set the button as follows.

3

My function was defined in my code behind but when I click on button, my code behind was never executed!

To avoid this, I attached my event in the “onload” of the page, and since it works perfectly.

4

Hope this help !

Christopher.

Advertisements
This entry was posted in SharePoint 2010 and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s