Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Toolbar > Javascript methods are coming as undefined
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Javascript methods are coming as undefined

Feed from this thread
  • Hari Prasad avatar

    Posted on Nov 11, 2010 (permalink)

    Hi,

    I have one aspx page, in that I am having .ascx user control. In this I am putting RadTabStrip control. In Tab click event, I am binding the other user controls dynamically. I have 5 tabs in user control. So I have 5 user controls loading dynamically. In 1st user control (dynamically loading user control) I am putting one more user control. In this I have lot of javascripts. and also in each and every user control has Ajaxification and lot of java script methods. The main aspx page will display in new window (window.open(url)). After clicking on each tab we are setting that tab as default tab. For example I have 5 tabs first time it will display the 1st tab, then I have clicked on 3rd tab made the changes and closed that tab, so next when I come to that page 3rd tab will display.......

    So now I am working on 1st tab, when come to this page 1st time, the total functionality is working fine. I cliked on 4th tab and closed the window and come back to that page, now the 4th tab will load. Now if I go to 1st tab, the javascripts are not working. Suppose in my user control I have OnClientButtonClicked, OnClientSelectedIndexChanged, OnClientLoad.....etc javascripts, when I come to this tab the following javascript error is coming

    "OnClientButtonCliked is undefined"

    If remove this method I am getting the following error

    "OnClientSelectedIndexChanged is undefined"

    like that I am getting the errors in flow.

    I have tried by writing the java script in .ascx(html) page and .ascx.cs(Code Behind), but no use.

    <

     

    telerik:RadCodeBlock ID="m_UIRadCodeBlock" runat="server">

    <

     

    script src="~/js/Test.js" type="text/javascript"></script>

     

    </

     

    telerik:RadCodeBlock>

     


    And also I have registered the java script by writing the js file as shown below

    Page.ClientScript.RegisterClientScriptInclude(

    "ClientScriptBlock", "~/js/Test.js");
    In OnLoad() event I am registering the java script (above code)

    Please give me the solution for this.

    Thanks in Advance,
    Hari.

     

  • Yana Yana admin's avatar

    Posted on Nov 12, 2010 (permalink)

    Hello Hari,

    Please use RadScriptBlock instead of RadCodeBlock. Let us know the result.

    Kind regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Hari Prasad avatar

    Posted on Nov 12, 2010 (permalink)

    Hi Yana,

    Thanks for your help. It's working fine now. But the problem is that I have one Custom control, that client id is coming as undefined, even control itself is coming as undefined, if 3rd tab is focusing 1st time. If 1st tab focusing, it's working fine.

    Hari.

  • Yana Yana admin's avatar

    Posted on Nov 15, 2010 (permalink)

    Hello Hari,

    The provided information is not enough for us to reproduce this issue, please send us more details and some more sample code.

    Greetings,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Toolbar > Javascript methods are coming as undefined