2014-03-28 30 views
0

後產生的錯誤,我有在我使用後就正常了JavaScript和ASP組件的ASPX頁面,但我添加了一個Telerik的組合框,現在它是生產一個錯誤:<% ... %>將Telerik的組件

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

我在我的JavaScript代碼這些事情之前,我加入了Telerik的代碼是工作的罰款:

$(function() { 
      $("#<%=CountryCity1.ClientID%>").hide(); 
... 
... 

<div id="CountryCity1" runat="server"> 

我也有一個jQuery自動完成服務在同樣的代碼也停止工作。

然後我換成這與

$(function() { 
      $("#<%#CountryCity1.ClientID%>").hide(); 
... 
... 

<div id="CountryCity1" runat="server"> 

,現在是不是網頁上的工作我已經加入Telerik的

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> 
     <AjaxSettings> 
      <telerik:AjaxSetting AjaxControlID="RadComboBox1"> 
       <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="RadComboBox2" /> 
        <telerik:AjaxUpdatedControl ControlID="RadComboBox3" /> 
       </UpdatedControls> 
      </telerik:AjaxSetting> 
      <telerik:AjaxSetting AjaxControlID="RadComboBox2"> 
       <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="RadComboBox3" /> 
       </UpdatedControls> 
      </telerik:AjaxSetting> 
     </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 

回答

0

的這段代碼你需要把你telerik代碼塊內的javascript代碼如下所示:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
<script type="text/javascript"> 
    function AjaxReq(args) { 
     $find("<%= RadAjaxPanel1.ClientID %>").ajaxRequestWithTarget("<%= Button1.UniqueID %>", ''); 
    } 
</script> 
</telerik:RadCodeBlock> 

參考:http://www.telerik.com/help/aspnet-ajax/ajax-radscriptblock-radcodeblock.html

+0

的作品十分感謝 – Jahangeer

相關問題