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

[Solved] RadScriptBlock and external JS files

2 Answers 238 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cedric
Top achievements
Rank 1
Cedric asked on 02 Mar 2010, 10:21 AM
Hi,

In an ASP.Net page, I am using a large amount of JS functions inside a RadScriptBlock element, to manipulate toolbar, tabstrip, panelbar ... on the client-side.
To easily maintain that, is there a way to load external javacript files containing these functions ?
I tried to used a <script type="text/javascript" src="script/myfunc.js"> inside the RadScriptBlock element, but that did not work : I got an error because JS methods are not found by server controls when executing ...

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 04 Mar 2010, 01:37 PM
Hello Cedric,

You can use the ScriptManager or a ScriptManagerProxy control to register your external scripts, as shown below for instance:

<asp:ScriptManager ID="sm" runat="server">
    <Scripts>
        <asp:ScriptReference Path="script/myfunc.js" />
    </Scripts>
</asp:ScriptManager>


Sincerely yours,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Cedric
Top achievements
Rank 1
answered on 05 Mar 2010, 08:37 AM
Thanks ! I totally forgot this feature from ScriptManager ...
Tags
General Discussions
Asked by
Cedric
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Cedric
Top achievements
Rank 1
Share this question
or