Refreshing Javascript SRC Without Full PostBack

Dear All,

Please can someone kindly assist me with the following.

We have an ASP.NET Label (or Literal) Control where the Text property which is rendered to the page is a Javascript script tag with a SRC pointing to a remote URL (that inserts a video player).

We are trying to change the Text property of this control to a different javascript SRC value to render a different video but without having to POSTBACK the whole page.

Whilst the Text property of the label IS getting changed, the script tag is not getting re-rendered, i.e. the new video file is not getting called.

We have tried partial AJAX postback and dynamic creation of new control but to no avail.  The only way that we can get the new <script src> to re-render is to effect a full POSTBACK which is not ideal for other reasons.

I am guessing this should be possible.  Something in PAGE_LOAD must be doing this?

Thank you for your time.
LVL 1
antdowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
This question requires some additional clarification.

An asp:Label whose Text property is a javascript script tag with a src pointing to a remote url?

I'm trying to get a mental picture of this.

Javascript script tag with a remote url for the src:
 <script type="text/javascript" src="http://remoteUrl.com"></script>

<asp:Label ID="whatever" Text="<script type='text/javascript' src='http://remoteUrl.com' />" runat="server" />

Why? It doesn't make sense.
antdowAuthor Commented:
Hi, and thank you for your response.

The URL looks something like this...

<script src="http://content.bitsontherun.com/players/nPripu9l-zNzx3xpv.js" type="text/javascript"></script>

The reason we are using this is that embedding this automatically provides us with a video player (JW Player) and loads a video (identified by the dynamically-generated ID).  This video is served by Bits On The Run, a Content Delivery Network.

Have tried a Label and Literal control.  Works perfectly EXCEPT when we try to refresh the dynamic value within the URL WITHOUT doing a full postback.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
antdowAuthor Commented:
Thanks CodeCruiser, this was incredibly helpful in getting this to work.  Apologies for the delay accepting your solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.