ASP.NET : Load flash movie from codebehind - asp.net

I have an ASP.NET web page where i need to show a flash movie. the flash movie file name i will get dynamically in my code behind code.Now i want to load this file name to the flash object from code behind. Whats the ways to do this ? Is there any other method i can render a flash movie in a web page other than the OBJECT tag ?
Is there anything to do with a ajax cal here ? any performance improvement we can achieve ?

I suggest using a javascript library called SWFObject. Then, from your code behind you can register a startup script using the client script manager that loads the movie that you want.
Here is a link to the project: http://code.google.com/p/swfobject/

I would recommend that you combine client and server side code on this. It's not an extremely clean solution; however, it probably will help meet your needs.
I would recommend using jQuery and some of it's Flash Plug-ins on the client side. Then in the server I'd just RegisterClientScriptBlock that would set the properties of the flash movie as you need them.
Here's a link to a jQuery Flash Plugin

Related

Manage ads inside a Single Page Application

I m developing a Single Page Application (SPA). So, I use to refresh the page's HTML's content dynamically using Ajax requests.
I'd like to register to the DoubleClick for Publishers program, but I m wondering if my SPA is able to integrate advertising due to its dynamic content loaded without refreshing the page.
I saw this link: https://support.google.com/dfp_sb/answer/3058726
So I assume it's ok. But I'd like to be certain before starting using DFP. Could someone confirm please?
Then, sometimes I m using external html pages that I still load using Ajax. Should I consider writing the advertising banners JavaScript inside these external views, or directly inside the master page of my app?
Last question: How can I manage users having an adblocker software installed? Am I allowed to detect the presence of an adblocker software using JavaScript and then execute some specific code for this kind of users?
I'm working in a SPA and working with DFP successfully. Here is my feedback to your questions:
So I assume it's ok. But I'd like to be certain before starting using
DFP. Could someone confirm please?
Yes, you can refresh the banners using the method you are refering in the link you shared
Then, sometimes I m using external html pages that I still load using
Ajax. Should I consider writing the advertising banners JavaScript
inside these external views, or directly inside the master page of my
app?
To load them externally will bring you to lower performance results. You can control everything from the main page and you will have better results.
Last question: How can I manage users having an adblocker software
installed? Am I allowed to detect the presence of an adblocker
software using JavaScript and then execute some specific code for this
kind of users?
This is something I have not started to work on it but you can detect (like forbes.com is doing on it website) and there are also projects on dealing with this.

how to create a file manager like CKFinder - MoxieManager with Asp.Net

I want to create an ajax file manager like CKFinder and MoxieManager using Asp.Net!
can anyone help me how to start ?
please suggest me some useful references , components and tips ...
If there is an open source project like what I need, please let me know.
You first start with a simple file manager (no ajax), that simple reads the files from the disk and renders them on a page. If you place all that inside an iframe dialog, then you have something like ajax for your page.
Some examples with the code and details:
Simple-Web-File-Manager
Web File Manager
ASP.NET User Control: File Browser
and you can call them from your page, using the highslide iframe dialog content example.
After you make that and you have some knowledge you can move to ajax (if you still need it)

HTML Snapshot for google using ASP.net

I have a website which content is created dynamically on the client using ajax, and I want to create a HTML snapshot for google crawler.
Since I Use ASP.net, my idea is to create an instance of WebBrowser control on the server, whenever google passes '_escaped_fragment_' parameter, then load my dynamic page on the server, and then return google the created page.
I have two questions:
1. Is there a better way to do this?
2. If there is no better way to do this, how should I implement it? should I use http handlers?
This may be late. Have you tried NHTMLUNIT(which is a wrapper to HTMLUNIT)?

load images using jquery ajax in asp.net

I am looking for a good approach on how to do the below
I have a file server where i store all of images.
I need to display these images onto my webpage using jquery and ajax.
Can someone please advise on how to do the above i can do the reading of the image from file server using a web service hosted on the file server which will return a byte array of the image, but once i read the byte array then how do i display it on the web page using jquery and ajax.
Please adivse
Thanks
Have a look at doing this with an HttpHandler.
HttpHandler Example: http://www.wrox.com/WileyCDA/Section/id-291916.html
If your're using MVC have a look at:
http://dotnet.dzone.com/news/goodbye-http-handler-hello?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fcss+(CSS+Zone)

How can I know when .aspx call is finished?

I am building a Flex Application that calls a .aspx page on the same webserver which builds a PDF report using SQL Reporting Services. When the report is built it prompts the user to open or save the PDF.
We are trying to find a way to display a Progress Bar to let the user know that the report they requested is being built, and then destroy the Progress Bar once the report is finished being built.
I've tried opening a new window using JavaScript and trying to catch when the window closes, as well as trying XMLHTTPRequest, but nothing to seems to work.
Does anyone have any suggestions?
There are 2 options:
Use the FileReference class in Flex to programmatically invoke your aspx file. You will be able to track the progress of the call from within Flex by listening to its events. But the users can only save the PDF, not open it.
Have an intermediate HTML page that displays a loading icon and then refresh itself to your PDF generating ASPX page. Encode your aspx url along with parameters etc and set it as a parameter to this intermediate page so it knows what to load.
If you don't have control over the page to be able to put JavaScript on it to hit a URL (or call back to the parent/opener), then you might consider whipping up an aspx page of your own to host a ReportViewer control, and display the report inside of that. This would require you to create a .NET website with a page and a web.config - you wouldn't need to do more than make it receive any parameters your report needs, and it would be do-able via inline-to-the-aspx code as opposed to requiring in-depth .NET knowledge.
Or, you could hit the SS-RS API and render the report directly. Here, you'd craft a URL with parameters for the report on the SS-RS API site to accept. I think, though I don't know for sure, that the SS-RS UI uses the API itself behind the scenes. By default the API is hosted in a site called "reportserver" - you might sniff HTTP traffic while the report is being rendered to get you started with the URL that you'd need to hit.
Another option not mentioned here is to create a .Net webservice, add it to your flex project and when it hits the result handler you know the file is created at that point.

Resources