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 ?

2 Answers 2


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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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