This is a migrated thread and some comments may be shown as answers.

why I got error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). for RadAjaxManager

2 Answers 212 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
khaled jendi
Top achievements
Rank 1
khaled jendi asked on 06 Apr 2012, 02:30 PM
hi,

I have RadTimePicker, and i need to forbid posting back when time is picked, so I have decided to use RadAjaxManager, now when I have use it and select time picker to update it self, I got this error in my other jquery/ javascript when I am getting ID of server controls client id:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

so what do I do to take out this error? or how do I prevent post back for time picker when time is selected?


2 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 07 Apr 2012, 09:46 AM
Hello Khaled,

Please check below code snippet.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
        
// Your JS code comes here
 
        </script>
    </telerik:RadCodeBlock>

for more info please check below link.
RadCodeBlock and RadScriptBlock

Thanks,
Jayesh Goyani
0
skimad
Top achievements
Rank 1
answered on 02 Aug 2012, 11:29 AM
Thanks, Jayesh. 
Tags
Ajax
Asked by
khaled jendi
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
skimad
Top achievements
Rank 1
Share this question
or