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


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.

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.


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.


Hope this help !



Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s