Thanks to everyone that I was able to get it to work correctly using a different method. in the code behind I created a function and in the function I put the following code
Return String.Format("openRadWindow({0},{1});", photo.ID, photo.ParentObjectID)
and in aspx I added onclick="<%#MyFunction(DirectCast(Container.DataItem,Photo))%>
source
share