Placing a chart into the HTML page
Crank up a project and what we will do first is to place a chart in the <html>
page. Go to Toolbox
(Ctrl + Alt + X), enter char...
in the Search
field, and drag and drop it below the line that begins with <form id=...
.
As you can see on your screen, this generates all of the following markup. You can leave it as is. It's sufficient for our purposes:
<asp:Chart ID="Chart1"runat="server"> <Series> <asp:SeriesName="Series1" ChartType="Point"></asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1"></asp:ChartArea> </ChartAreas> </asp:Chart>
You can delete the two <div...
lines and the <asp:Label ID...
line. We don't need them.
Adding a button to the HTML page
Next, you need to place a button below the </asp:Chart>
line. So again, go to Toolbox
, grab a Button
control, and drag it in there. Change the text on the button to say Load Data
. Here, Load Data
means...