how to use the api in an ascx file

Nov 15, 2010 at 2:00 PM

how to reference the api in an ASCX?

Coordinator
Nov 16, 2010 at 8:36 AM

Hi.

do not know, sorry :)

it is old project, now i am oriented to the Silverlight

May 12, 2011 at 6:42 PM
Edited May 12, 2011 at 6:43 PM

I've done it by adding the following to the ascx file:

 

<%@ Register Assembly="GoogleVisualizationAPI" Namespace="GoogleVisualizationAPI"
    TagPrefix="gvapi" %>

    <gvapi:GoogleContainer ID="graph1" ClassName="clientVisualization" runat="server" />

 

in the masterpage add runat="server" to the head tag. This enables you to do the following in codebehind(ascx.cs) of the  file:

 

            var GVAPI = new GoogleVisualization();
            GVAPI.ID = "GVAPI";
            Page.Header.Controls.Add(GVAPI);

and then just look at the sample for the project on how to add data to the GoogleContainer