Im using VS 2005 and I want to find the best way to create a Dundas chart dynamically. In my codebehind, I have a procedure that creates the markup tags for a Dundas chart. When the page renders, it doesnt display anything but the view code shows the tags for the chart.
I know its probably something with the rendering of html in the whole .net process. What is the best way to do this? Ive created dynamic controls in various ways, but this seems to be a little different since Im building a string and then trying to render. Below is the basic code that is run when a user clicks a button on the page.
string dundasXML = "";
dundasXML = "<DCWC:CHART id='Chart1' runat='server' RenderType='InputTag' ImageType='Png' >";
dundasXML += "<Series>";
dundasXML += "<dcwc:Series ChartType='SplineArea' Name='Series1'>";
dundasXML += "<Points>";
dundasXML += "<dcwc:DataPoint YValues='6'></dcwc:DataPoint>";
dundasXML += "<dcwc:DataPoint YValues='9'></dcwc:DataPoint>";
dundasXML += "<dcwc:DataPoint YValues='3'></dcwc:DataPoint>";
dundasXML += "</Points>";
dundasXML += "</dcwc:Series>";
dundasXML += "</Series>";
dundasXML += "<ChartAreas>";
dundasXML += "<dcwc:ChartArea BorderColor='' Name='Default' BackColor='Transparent'>";
dundasXML += "</dcwc:ChartArea>";
dundasXML += "</ChartAreas>";
dundasXML += "</DCWC:CHART>";
LiteralControl l = new LiteralControl(dundasXML);
myPanel.Controls.Add(l);