Q:

How to parse data from ViewData

I am trying to parse data from my ViewData but its not going so well. 
Controller:
public ActionResult ListFilm()
        {
            MediaCatalog mediaCL = new MediaCatalog();

            // Retrieve a list of film media's
            List<CatalogDb. FilmMedia> listFilmMedia = new List<CatalogDb. FilmMedia>();
            listFilmMedia = mediaCL.GetAllFilmMediaTitles();

            ViewData["FilmList"] = listFilmMedia. ToList();

            return View();
        }

View:
<% foreach(var item in (ViewData["FilmList"] as List<CatalogDb. FilmMedia>)) { %>
<%=item.title %>
<% } %>

I noticed that the code written in my view file is parsed directly in the source, so for some reason its not being executed as code? 

A:

I personally use the ViewBag property, it has been added to ASP.NET MVC3.  It uses the dynamic under the hood, which makes the ViewBag also strongly typed. ( ViewData uses a dictionary under the hood and thus always returns an object , which you have to cast). 
So basically, instead of using ViewData["MyPropery"] as MyType, you can directly call ViewBag. MyProperty and you don't need to cast it (to "MyType").