开发者

can not add webpart to sharepoint page

开发者 https://www.devze.com 2023-01-02 09:38 出处:网络
i create a web开发者_StackOverflow社区site on my local machine but i can\'t add webpart to web page, it don\'t rise any error but th webpart don\'t display to the page. anyone help me.

i create a web开发者_StackOverflow社区site on my local machine but i can't add webpart to web page, it don't rise any error but th webpart don't display to the page. anyone help me. Thanks


I know this is an old question, but it's ranking high in Google results, so I figured I'd answer it anyway.

Make sure you're not running any code in the layout page's codebehind that calls and then closes SPContext.Current.Web. I had this exact behavior and that was the culprit

To test, add a different web part to a default page layout. If it adds, then it's either your web part or your code behind. If you can't add any web parts to your custom layout, it's your code behind. If it's just your web part, it's your web part.

Remember, SPContext.Current.Web returns a reference to the current SPWeb object. SharePoint will close the object itself when it's done, and closing it early can cause "unpredictable behavior."


We had the same problem with Firefox some time ago, but the problem disappeared when we installed SP2 for SharePoint 2007. The only thing that surprises me is that you also have the problem with IE.

0

精彩评论

暂无评论...
验证码 换一张
取 消