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

External Javascript File in Update Panel

2 Answers 277 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 05 Apr 2011, 10:37 AM
Hi,

It's the end of a long dev cycle and my brains gone to mush, so I'm sure I am missing something really simple but don't seem to be able to find a solution.

I have some external js for advertising banners like this...
<script type="text/javascript">
var uri = 'http://sampleurl/imp?type(img)g(111)a(222)' + new String(Math.random()).substring(2, 11);
document.write('<a id="a_manuallyadded" href="http://sampleurl/click?p=111&a=222&g=333"
target="_BLANK"><img id="i_manuallyadded" src="'
+ uri + '" border=0></a>');
                    
</script>
...which are located within a RadAjaxPanel.    After an async call the banners disappear, if I wrap them in a RadScriptBlock then after the call the rest of the page disappears and I'm left with the banner.

Unfortunatley due to the layout I can't really not include the banners in the ajax panel.  

Thanks
Rich



ps. Congrats on the new website, so much easier to work with and I think it looks better too.

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 07 Apr 2011, 04:04 PM
Hi Richard,

One possible approach in your case is to use ResponseScripts method of the RadAjaxPanel control. See the link below for more information on this matter:
http://www.telerik.com/help/aspnet-ajax/ajax-execute-custom-javascript.html

Another option is to use ScriptManager.RegisterStartupScript Method or ScriptManager.RegisterClientScriptInclude Method  if external js file should be include.

I hope this helps

Kind regards,
Maria Ilieva
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
Richard
Top achievements
Rank 1
answered on 16 Apr 2011, 03:18 PM
Okay thanks, for information I found the simplest solution was to start using the Ajax manager instead of the panel, I had wanted to avoid that because of the number of controls involved but in the end it was the best move for me.

Thanks anyway.

rgds
R
Tags
Ajax
Asked by
Richard
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Richard
Top achievements
Rank 1
Share this question
or