ColorPicker JS error inside another Rad/Ajax control

3 posts, 1 answers
  1. Mazdak
    Mazdak avatar
    30 posts
    Member since:
    Nov 2010

    Posted 22 Dec 2010 Link to this post

    I got this JS error when I put ColorPicker inside another AJAX control:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; .NET4.0C; .NET4.0E)
    Timestamp: Wed, 22 Dec 2010 14:14:10 UTC

    Message: Invalid argument.
    Line: 4146
    Char: 24
    Code: 0
    URI: http://localhost:53359/wisdom/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3aacfc7575-cdee-46af-964f-5d85d9cdcf92%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.3.1215.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a8c7a5421-4dd4-41ca-a3e5-203852b3dd8e%3a16e4e7cd%3a874f8ea2%3af7645509%3a24ee1bba%3af46195d3%3a19620875%3a490a9d4e%3abd8f85e4%3aa44b89c4%3a1e771326%3af9b9258%3bAjaxControlToolkit%2c+Version%3d4.1.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3aacfc7575-cdee-46af-964f-5d85d9cdcf92%3a923aa3cc%3a853c2e0b%3a46f97eb1%3a782b16ab%3a535785ef%3af48dface%3a50114f04%3a29340eb0%3a8a480787


    The ColorPicker works fine outside the AJAX control, here is an sample which gives this error:




    asp:TextBox ID="DateTextBox" runat="server" Width="80" autocomplete="off" /><br /><br />




    <asp:Panel ID="Panel1" runat="server" CssClass="popupControl">




    <table style="width:310px;">








    <td style="white-space:nowrap;width:200px;vertical-align:top;">


    Header Colour:











    <telerik:RadColorPicker runat="server" ID="RadColorHeader" PaletteModes="All"




    SelectedColor="98, 108, 137">

























    <ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server"












    Position="Right" />



  2. Answer
    Tsvetie avatar
    1517 posts

    Posted 23 Dec 2010 Link to this post

    Hello Mazdak,
    I was able to quickly reproduce the problem you describe, based on the provided information and code. The problem manifests, when the color picker is initialized in an invisible parent element (an element with "display:none;" style setting). We will fix it for Q3 2010 SP2. For the time being, you can use the following workaround:
    <script type="text/javascript">
    Telerik.Web.UI.RadColorPicker.prototype._oldinitializeFields = Telerik.Web.UI.RadColorPicker.prototype._initializeFields;
        Telerik.Web.UI.RadColorPicker.prototype._initializeFields = function()
            this._showIcon = true;
            this._showIcon = false;

    As you are not using a Telerik control to hide/show the color picker, you will have to call its repaint method manually as soon as the PopupControlExtender shows the "Panel1" panel. The controls from the RadControls for ASP.NET AJAX suite call this method in such cases internally.

    Kind regards,
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. DevCraft R3 2016 release webinar banner
  4. Mazdak
    Mazdak avatar
    30 posts
    Member since:
    Nov 2010

    Posted 24 Dec 2010 Link to this post

    Thanks a lot, the patch solve my problem in both threads.
Back to Top