1

I created a new webapart and added it to a page. After adding, I was unable to save the page from editing mode, but if I remove my webpart and try to save, it's saving. Not sure what is the error.

Can any one let me know what might be the problem?

1
  • Do you use JavaScript in the web part? Often this is the cause of no respond from ribbon! can you provide some code? Feb 1 '13 at 22:21
3

You need to modify any validation code in your web part to ignore validation if the page is in edit mode.

You can do this server side using this code snippet in in the web-part. Make sure to add this using statment as well. using System.Web.UI.WebControls;

//if we are not in display mode disable all the validation controls to make sure saving the page the webpart is on works.
if (WebPartManager.DisplayMode != WebPartManager.BrowseDisplayMode)
{
    foreach (var validator in Controls)
    {
        if (validator is BaseValidator)
        {
            ((BaseValidator)validator).Enabled = false;
        }
    }
}
1
1

Make sure the page is not locked or checked out by anyone else.

0

Sometimes I see this and am able to resolve it by going to site content / pages and manually checking out the page. I am not sure why this is a problem but I have had success with this workaround.

0

This seems like library version is on. So the page you edit will only reflect to admin user. Unless and until you check in the page other users can't see changes.

0

I have seen this before, my solution is that if your WebPart has any validator, you should fill some data to pass this/these validator(s) for saving your page. It often happens in SharePoint. Hope to help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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