This is a migrated thread and some comments may be shown as answers.

How to add a script at runtime

3 Answers 145 Views
Dock
This is a migrated thread and some comments may be shown as answers.
madhu
Top achievements
Rank 1
madhu asked on 11 Jun 2007, 05:07 PM
Hi
I need to add a javascript code at runtime in the RadDock which is created dynamically.
Can anyone help on this?
Thank you.

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 12 Jun 2007, 10:18 AM
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
0
Brad
Top achievements
Rank 1
answered on 19 Mar 2008, 07:39 PM
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?
0
Dimcho
Telerik team
answered on 20 Mar 2008, 12:56 PM
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
Tags
Dock
Asked by
madhu
Top achievements
Rank 1
Answers by
Petya
Telerik team
Brad
Top achievements
Rank 1
Dimcho
Telerik team
Share this question
or