Tabstrip, Ajax, Usercontrols

2 posts, 0 answers
  1. Sam Stange
    Sam Stange avatar
    15 posts
    Member since:
    Jul 2006

    Posted 04 May 2009 Link to this post

    Hoping someone can help me... I've got a tab strip and some usercontrols I load dynamically. I'm using both the RadControls for ASP.NET and the RadControls with Ajax. 1st, I can't use javascript in my usercontrols. I've tried registering the clientscript onload, using the radscriptblock, using the radcodeblock, with no luck. As soon as I turn off ajax on the manager, everything loads up correctly. I'm using the same approach as:

    Is there another kind of trick or best practice when it comes to registering javascript in a web usercontrol? Should I place the scripts in a centralized .js file?


  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 06 May 2009 Link to this post

    If you want JavaScript to fire when the page loads, try using the ASP.NET AJAX pageLoad event handler, like this:

    function pageLoad(){
    //Your code here

    That event will get automatically fired by ASPNET AJAX when the page is ready to go. You can use this in your UserControl and it should fire correctly.

    Let me know if that helps.

Back to Top