Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
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

1 Answer 1

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

 
discard

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.