PDA

View Full Version : ASP error


brad211987
07-17-2007, 02:13 PM
I'm completely new to ASP, and trying to use a program called dotnetCharting, to create dynamic charts. I'm loading a sample page right now, and receiving this error:

XML Parsing Error: not well-formed
Location: http://localhost/dotnetcharting/MyCharts/a01.aspx
Line Number 1, Column 2:<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
-^


Here is the sample code from the page that I am trying to load and getting this error from:


<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>


<script runat="server">

SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random();
for(int a = 0; a < 4; a++)
{
Series s = new Series();
s.Name = "Series " + a;
for(int b = 0; b < 5; b++)
{
Element e = new Element();
e.Name = "E " + b;
e.YValue = myR.Next(50);
s.Elements.Add(e);
}
SC.Add(s);
}

// Set Different Colors for our Series
SC[0].DefaultElement.Color = Color.FromArgb(49,255,49);
SC[1].DefaultElement.Color = Color.FromArgb(255,255,0);
SC[2].DefaultElement.Color = Color.FromArgb(255,99,49);
SC[3].DefaultElement.Color = Color.FromArgb(0,156,255);
return SC;
}


void Page_Load(Object sender,EventArgs e)
{
// Set the title.
Chart.Title="My First Chart";


// Set the x axis label
Chart.XAxis.Label.Text="X Axis Label";

// Set the y axis label
Chart.YAxis.Label.Text="Y Axis Label";

// Set the directory where the images will be stored.
Chart.TempDirectory="temp";

// Set the bar shading effect
Chart.ShadingEffect = true;

// Set he chart size.
Chart.Width = 600;
Chart.Height = 350;

// Add the random data.
Chart.SeriesCollection.Add(getRandomData());


}
</script>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Gallery Sample</title></head>
<body>
<div style="text-align:center">
<dotnet:Chart id="Chart" runat="server"/>
</div>
</body>
</html>




Does anyone see any reason in the code to get this error? Or does this hint at a configuration problem in IIS maybe?

Any ideas are greatly appreciated.

vinyl-junkie
07-17-2007, 04:49 PM
I think you need a space before your closing %> like so:

<%@ Page Language="C#" Description="dotnetCHARTING Component" %>

brad211987
07-17-2007, 05:12 PM
Still comes back with same problem, do you have to do anything in IIS to enable support for scriptlets inside of <%%> tags? That seems to be where the problem is indicated, line1, column2. I would have thought that this would be native on IIS.