Search code examples
asp.netsharepointweb-parts

Sharepoint "edit page" keeps loading due to certain webpart


I have a sharepoint test page. I inserted my webpart earlier before my development, but after a period of time now I find that when I click "edit page", the "loading" tag will run forever and I cannot edit my page.

Then I tried to type "?Contents=1" after my page url, delete the webpart and re-add it. When I tried to save my changes, the "saving" tag also runs forever.

Such issue only happens to my webpart. I tried to use other webparts and they works perfectly. Any one got some idea?


Solution

  • OK,I find the reason. Since my webpart has an textbox validator and by default the textbox is hidden, when I click "edit page", the validator will be fired and prevent the editing. I put the following code in my page_load JavaScript and the issue is solved.

    $(function () {
        var rfv = document.getElementById("<%=rfvName.ClientID%>");
        ValidatorEnable(rfv, false);
    });