PDA

View Full Version : The Controls collection cannot be modified because the control contains code blocks (i.e. ).



flaviodamaia
Jan 28, 2010, 8:17 AM
Hi,

I'm working with Coolite 0.8.2 and when I open some page.aspx where hava the some line with <%=...%>, the following error occurs(Images Attached).
I have a gridPanel where I have some js, when I insert the line below on the js of the gridPanel, occurs the error information wich are on the images attached.



<%=txt_dstId.ClientID %>.setValue(id);


I would like know how can I do?

Thanks!

Flavio da Maia.
Coolite 0.8.2.

Vladimir
Jan 28, 2010, 8:27 AM
Hi,

This exception occurs if you use <%=...%> inside header. Move that code outside header or use TokenScript control inside header (with #{} syntax)

flaviodamaia
Jan 28, 2010, 8:50 AM
Hi Vladimir,

Sometimes I use the syntax #{...}.syntax when I need use on the Handler, but I forever used the syntax <%=...ClientID%>.syntax. Example: http://examples1.ext.net/#/GridPanel/Miscellaneous/Details_Window/
I tried use the #{...}.syntax on the part of JS but isn't worked.

This is my src on JS:



<script type="text/javascript">

var getIdDst = function(grid, rowIndex, columnIndex) {
var record = grid.getStore().getAt(rowIndex);
var columnId = grid.getColumnModel().getColumnId(columnIndex);
var columnValue = grid.getColumnModel().getDataIndex(0);
var id = record.get(columnValue);
<%= txtId.ClientID%>.setValue(id);
}

</script>



This is my src on Coolite:


<Listeners>
<CellClick Fn="getIdDst" />
</Listeners>



When I used the asd 0.8.1 this syntax worked, but on the asd 0.8.2 isn't work and occur the error informed in the last post.

Thanks!

Flavio da Maia.
Coolite 0.8.2.

flaviodamaia
Jan 28, 2010, 4:36 PM
Hi Vladimir,

The problem was solved!

Thanks attention!

Flávio da Maia.
Coolite 0.8.2.