Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Ajax Color Picker Control.when i try to run the page.i am getting this error.
Please help..
Thanks in advance.


Here is Code:


XML
<asp:Content ID="ColorContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            registerDialogBox();
        });
        function colorChanged(sender) {
            sender.get_element().blur();
            sender.get_element().style.color = '#FF3300';
            // + sender.get_selectedColor();
            sender.get_element().style.backgroundColor = '#' + sender.get_selectedColor();
        }
    </script>



XML
<div class="tutor_details">
                          <h1>
                              Color Details</h1>
                          <div class="td_div" style="height: 170px;">
                              <div class="grid">
                                  <label>
                                      Manufactorer</label>
                                  <asp:DropDownList ID="ddlManufactorer" runat="server" CssClass="input_2" AutoPostBack="true"
                                      OnSelectedIndexChanged="ddlManufactorer_SelectedIndexChanged" />
                              </div>
                              <div class="clr">
                              </div>
                              <div class="grid">
                                  <label>
                                      Product</label>
                                  <asp:DropDownList ID="ddlProduct" runat="server" CssClass="input_2" />
                              </div>
                              <div class="clr">
                              </div>
                              <div class="grid">
                                  <label>
                                      Color</label>
                                  <asp:ColorPickerExtender ID="ColorPickerExtender1" TargetControlID="txtcolor" OnClientColorSelectionChanged="colorChanged" runat="server">
                                  </asp:ColorPickerExtender>
                                  <asp:TextBox ID="txtcolor" runat="server" Height="29px" Width="144px" />
                              </div>
                              <div class="clr">
                              </div>
                              <div class="grid padding_top">
                                  <table width="100%" border="0" cellspacing="0" cellpadding="0" style="width: 98%">
                                      <tr>
                                          <td align="right" valign="top">
                                              <div style="float: right;">
                                                  <asp:Button ID="Button_save" runat="server" Text="Save" CssClass="blue_btn" Width="60px"
                                                      OnClick="Button_save_Click" />
                                                  <asp:Button ID="btn_Cancel" OnClientClick="closeDialog();" runat="server" Text="Cancel"
                                                      CssClass="blue_btn" Width="60px" OnClick="btn_Cancel_Click" />
                                              </div>
                                          </td>
                                      </tr>
                                  </table>
                              </div>
                          </div>
                      </div>








VB
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +9601391
   AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:323
   AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in f:\TeamCity\buildAgent\work\80acd78aa4c25314\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:305
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Control.LoadRecursive() +145
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
Posted
Updated 17-Jul-13 1:19am
v3

1 solution

since you did not posted your code, we cant exactly tell where you need to make changes
You need to use <# instead of <= in your page
Have a look at these to solve your issue

Link1[^]

Link2[^]

Link3[^]

Link4[^]
 
Share this answer
 
Comments
RahulRana723 17-Jul-13 6:51am    
thanks for reply
RahulRana723 17-Jul-13 6:51am    
if i remove my ajax colorpicker control then all are working fine
Naz_Firdouse 17-Jul-13 6:55am    
somewhere in your color or the functions it calls, you may be using <=. so replace it with <#

Mark as answer and vote up if it helps you
RahulRana723 17-Jul-13 7:01am    
no sir,i have check my all code..
RahulRana723 17-Jul-13 9:12am    
Thanks sir you are right.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900