Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Controls collection cannot be modified because the control contains code blocks

$
0
0

The source of the problem happens when I add the Ajax Control Toolkit Tabbed Control to my page. I have some JavaScript on my page that looks like this:

functionClientItemSelectedAtty(sender, e){$get('<%= hdnAutoCompleteAtty.ClientID %>').value = e.get_value();// performs a PostBack to server on selection of an ListItem __doPostBack(('<%= hdnAutoCompleteAtty.ClientID%>').value,"");}

I did some research and found that when using the Ajax Tabbed Control this error occurs. The next step is to change the JavaScript code to look like this:

functionClientItemSelectedAtty(sender, e){$get('<%# hdnAutoCompleteAtty.ClientID %>').value = e.get_value();// performs a PostBack to server on selection of an ListItem __doPostBack(('<%# hdnAutoCompleteAtty.ClientID%>').value,"");}

That did fix the immediate issue, however, my application still breaks because I am also using the Ajax AutoCompleteExtender control. So when a user enters some text into the ACE textbox it loads a drop-down with data and the user can click on an item. When this click event occurs it fires off to this JavaScript function "ClientItemSelectedAtty".  What this JavaScript function is doing is passing the selected item of the ACE control to a hidden textbox and then performing a refresh or PostBack.

This brings me to my next problem ... I am getting a new error when this JavaScript function is called stating it cannot find/access the "value" of the JavaScript request as shown here ...

functionClientItemSelectedAtty(sender, e){$get('').value = e.get_value(); __doPostBack(('').value,"");}

It blows up on the first line as it appears it doesn't know what to get. It looks like the fieldname of the control is now missing.

I am absolutely stumped as to what to do now. Any ideas? Thanks.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>