Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to develop a web part (For: MOSS2007 and SP2010) that displays Flash file (.swf), and I found out this source code (http://www.codeproject.com/KB/sharepoint/MOSSFlashWebPart.aspx) which seems good.

However, my problem is that I want to improve this web part by letting the web part checks if the visitor's browser supports Flash or not. I have checked out the script on: (http://www.adobe.com/products/flashplayer/download/detection_kit/), But I am not able to get it working within my web part.

In my web part, I am calling the script in page load. But it seems that the script runs before rendering html content. Therefore, I am unable to get the output from the script in the server side code.

So, could you please tell me how to tackle this issue ?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Use the ScriptLink.Register control in your web part and specify the script path in it.

Further in your script add the SharePoint OOB JS mehod _spBodyOnLoadFunctionNames.push("Check_Plugin"); and specify the JS method name that checks the browser plugin.

Any method specified in _spBodyOnLoadFunctionNames.push would be called after the page HTML has finished loading.

ScriptLink.Register http://msdn.microsoft.com/en-us/library/ms450390.aspx

share|improve this answer
add comment

You can have the swf object in a html page with the browser support code and put a Page viewer webpart and show the html page in that

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.