How to add a script at runtime

4 posts, 0 answers
  1. madhu
    madhu avatar
    29 posts
    Member since:
    Mar 2007

    Posted 11 Jun 2007 Link to this post

    Hi
    I need to add a javascript code at runtime in the RadDock which is created dynamically.
    Can anyone help on this?
    Thank you.

  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 12 Jun 2007 Link to this post

    Hi,

    I am attaching one of our online examples - My Portal where RadDocks are created dynamically and user controls are loaded inside of them - it is modified so that script is registered in each dock using ScriptManager.RegisterClientScriptInclude. The script is in a separate file JScript.js. When a dock is added to the page and a button inside the dock is clicked the script is executed. For the purpose of the example, the executed script is a simple alert "Hello".

    Kind regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Brad
    Brad avatar
    2 posts
    Member since:
    Oct 2007

    Posted 19 Mar 2008 Link to this post

    I thought this example might assist me in my troubles, but it appears not. To give you the scenario, I am wanting a Dynamically added RadDock using a UserControl to display the Current Time. The end result is to show my users the current time for the customer they have selected.

    We are using Javascript to show the time. It will only work after a Postback. When added dynamically, nothing happens until that postback.

    Any ideas?
  4. Dimcho
    Admin
    Dimcho avatar
    45 posts

    Posted 20 Mar 2008 Link to this post

    Hi Brad,

    Thank you for contacting us.

    I am not sure whether I understand you correctly. I assume that you want to show customer's current time without making postback to the server. I could suggest you try to extract the customer's current time using WebServices. Please, let me know If I have misunderstood you. I would like to ask you for more details about the scenario you want to achieve and the way you find customer's current time so that we can get a better idea of your scenario and do our best to help you with this issue.
     
    Greetings,
    Dimcho
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top