Opening contribution list in edit mode on page load

Yehuda Lando asked on August 11, 2014 21:00

Hi,

Like the title says, I want to open a contribution list in edit mode on page load. I have a page with a button to add a new document on top. This button is just a link to another page where the user can insert a new document.

I've already copied the User contribution list web part, and related controls, and changed what I needed to make it open in edit mode. But sometimes after an hotfix it stops working correctly (the form shows, but the save doesn't work correctly. Now after 8.0.18 or 19, it logs the user out. I debugged it for many hours today and I can't seem to find why it happens).

So is there a way to use the default web part and force it to show in edit mode when the page loads?

Thanks, Yehuda

Recent Answers


Sandro Jankovic answered on November 21, 2014 13:24

Hello,

You would need to customize the following control and its code behind: ~\CMSModules\Content\Controls\UserContributions\ContributionList.ascx

By default, the editing form is displayed only after the new document link has been clicked. Therefore, you need to hide this button and the code that gets executed in its click handler (the btnNewDoc_Click method) move to the Page_Load method for example.

Please let me know if you have any additional questions.

Best Regards,

Sandro

0 votesVote for this answer Mark as a Correct answer

Yehuda Lando answered on December 2, 2014 19:16

Thanks Sandro. I did customize the web part to be open in edit mode on page load.

It would be great to have this functionality built in. I have this requirement on almost all sites I developed using Kentico.

0 votesVote for this answer Mark as a Correct answer

Nick Dubé answered on March 31, 2016 08:03

Hi Yehuda,

This is exactly what we need however I got lost moving the btnNewDoc_Click method to the Page_Load method in the ~\CMSModules\Content\Controls\UserContributions\ContributionList.ascx

Are you able to supply us with a code example ?

Thanks

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.