SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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