5 Answers, 1 is accepted
0
Accepted
Hello Robert,
Could you please provide more information about the page with the problematic code blocks? In what context is the page called?
Please check out the below articles for more information of this error and see if the suggestions there are helpful:
http://blogs.msdn.com/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx
http://svengillis.blogspot.com/2008/03/code-block-are-not-allowed-in-this-file.html
Let me know how it goes.
Regards,
Iana
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Could you please provide more information about the page with the problematic code blocks? In what context is the page called?
Please check out the below articles for more information of this error and see if the suggestions there are helpful:
http://blogs.msdn.com/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx
http://svengillis.blogspot.com/2008/03/code-block-are-not-allowed-in-this-file.html
Let me know how it goes.
Regards,
Iana
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0

Robert
Top achievements
Rank 1
answered on 13 Apr 2009, 04:37 PM
Thanks for the reply. Let me make sure I understand. I thought that adding
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
would stop the "code block" error.
So even though I have a radcodeblock control I still need to set the page parserpath property?
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
would stop the "code block" error.
So even though I have a radcodeblock control I still need to set the page parserpath property?
0
Accepted
Hello Robert,
Indeed, you still need to set page parserpath property.
As you already found, RadCodeBlock should be used when you have server code blocks placed within the markup. And it is to prevent you from the server error: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
You should use RadCodeBlock especially when you have RadAjax on your page.
Unfortunately it could not prevent you from the error you faced.
All the best,
Iana
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Indeed, you still need to set page parserpath property.
As you already found, RadCodeBlock should be used when you have server code blocks placed within the markup. And it is to prevent you from the server error: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
You should use RadCodeBlock especially when you have RadAjax on your page.
Unfortunately it could not prevent you from the error you faced.
All the best,
Iana
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0

Bhavya
Top achievements
Rank 1
answered on 22 Dec 2015, 06:07 AM
Hi,
Greetings!
Please help me out from my problem, it may be small but i cant make it out.
I am using a RadTreeView. its working fine but my requirment is i want to add some condition in between nodes of treeview. so that i have to display nodes based on that if condition.
Thanks in advance. :)
0
Hi,
As the question is about RadTreeView control I recommend you open a new ticket, choose the correct product and your question will be addressed accordingly.
Regards,
Pavlina
Telerik
As the question is about RadTreeView control I recommend you open a new ticket, choose the correct product and your question will be addressed accordingly.
Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items