I have a custom webpart which inherits from the CQWP and I want to insert and configure it in one of my pagelayouts.

I do this using SharePoint Designer and it's no issue inserting it. It's the configuration of it that courses a bit of trouble.

When I insert it I get this error:

Error Rendering Control
Request is not available in this context.

And when I right-click on it and choose Web Part Properties... I get the following error:

The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML

It seems to do this with all custom webparts I insert, but the other webparts gets showed correctly on the website when displayed in a browser. But my custom CQWP throws an Unable to display this Web Part error.

Is this casual behavior from SharePoint Designer, when inserting webparts inheriting the CQWP?

  • 1
    Can check in the logs and share the actual stack trace of the error you get when you open the page in browser? – justforkix09 Jan 2 '12 at 14:26
  • Did you try debugging your custom web part when it is loaded in the browser? – Deepu Nair Jan 2 '12 at 17:36
  • Does it work when you add it on a page via Browser and not designer – Amit Kumawat Jan 3 '12 at 8:48

I have added instances of extended CQWP from designer without problem. It will always show error in the designer as designer lacks HttpContext which the CQWP depends upon. However when opened in browser it works fine.

Your error when page is opened in browser seems similar to the errors we get when the xslt is not proper. So stack trace of the error when you open the page in browser will be helpful.

|improve this answer|||||

Your Answer

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