How can I move RadCodeBlocks into an external .JS file? It seems like when I do, the <%= XXXX.ClientID %> formatting doesn't get parsed correctly.
1 Answer, 1 is accepted
answered on 06 Jun 2012, 03:24 PM
You can use inline asp tags only in asp files. So if you have such tags in your JS you will need to rewrite in such a way that not to use them, and only then you will be able to place the code inside external file.
I see several options for doing that:
1. Use global variables in the JS of your asp page that to holds the value calculated by the inline tags. And then later use these variables in the external js file.
2. Do not use these tags at all. Use events of the controls and store the "sender" into some variables when needed.
3. Use directly the ID of the controls when you know them and they are not dynamically set.
You can write us some examples in which you use these tags, and we could try to point you some workarounds for the exact cases.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.