⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debugging.aspx

📁 掌握学习.net开发的非常好的资料
💻 ASPX
字号:
<%@ Import Namespace="System.Drawing" %>
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Page Language="C#" debug="true" Description="dotnetCHARTING Component" %>

<script runat="server">

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


	return SC;
}


void Page_Load(Object sender,EventArgs e)
{

	Chart.Type = ChartType.Combo;//Horizontal;
	Chart.TempDirectory = "temp";
	
	// Set this property in order to get error messages when the chart has problems:
	Chart.Debug = true;
	
	
	// If there is a problem with the data engine, we can also debug it with the following:
	
	// We setup a dataengine object and cause an error.
	DataEngine de = new DataEngine();
	de.ConnectionString = "error causing connection string";
	de.SqlStatement = "error causing statement";
	SeriesCollection sc = de.GetSeries();
	
	// Now assign the error message to a label on the page.
	Label.Text = "DataEngine ErrorMessage: " + de.ErrorMessage;
	
	
	Chart.YAxis.Scale = Scale.Time;
	

	// Add the random data.
	Chart.SeriesCollection.Add(getRandomData());
    
    
}
		</script>
<HTML>
	<HEAD>
		<TITLE>Debugging Sample</TITLE>

	</HEAD>
	<BODY>
		<DIV align="center">
			<dotnet:Chart id="Chart" runat="server" /><br>
			<asp:Label id="Label" runat="server" />
		</DIV>
	</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -