RadColorPicker - Invalid Argument (JS Error)

2 posts, 0 answers
  1. m
    m avatar
    4 posts
    Member since:
    Sep 2007

    Posted 04 Feb 2009 Link to this post

    I am getting a javascript error - 'Invalid Argument' when I try to select a color using RadColorPicker.
    I have added following code in my aspx


    <telerik:RadColorPicker ID="RadColorPicker1"















    OnClientColorChange="ChangeColor" runat="server" />

    I have follwoing script:



    script language="javascript" type="text/javascript">



    var ChangeColor = function(a,eventArgs) {




    this.ClientID %>.Color = (eventArgs.get_color) ? eventArgs.get_color() : a.get_selectedColor();


    </script >

    I am suspecting this to be some version (may be RAD version / XML version / IE version) issue. 

    On debugging I fpund that the issue is  in ScriptResource.axd  in the following function. error line marked in bold:



    var _15=(this._selectedColor==_13.value)?"selectedcolor":"colorbox";

    var li=document.createElement("li");

    var _17=document.createElement("a");




    _17.style.background=_13.value; // HERE IS WHERE MY DEBUGGER STOPS

    var _18=this._createSpanEl("",_13.value);





    return li;





    Please guide.

    Thanks and Regards,

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 06 Feb 2009 Link to this post

    Hello Maitreyee,
    I tried to reproduce the problem you describe, but to no avail. Below is the code of my page:
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScritpManager1" runat="server"
            <telerik:RadColorPicker ID="RadColorPicker1" ShowIcon="true" Preset="Standard" ShowEmptyColor="false" 
                SelectedColor="#000000" OnClientColorChange="ChangeColor" runat="server" /> 
            <script language="javascript" type="text/javascript"
                var ChangeColor = function(a,eventArgs)  
                    <%= this.ClientID %>.Color = (eventArgs.get_color) ? eventArgs.get_color() : a.get_selectedColor(); 
            </script > 

    I tested in both IE and FF with the latest version of the suite, as you have specified - version 2008.3 1314.

    I actually did get an error - "__Page is not defined", but it was not connected to the code of the RadColorPicker, but rather to the following line:
    <%= this.ClientID %>.Color 

    In case you can send me a simple running project, demonstrating the problem, I will do my best to find what is causing it.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top