I'm trying to create a simple ASPX file with no code behind as part of a Windows gadget application I'm writing used to display a gauge within a gadget. The code below is very similar to the nevron nocodebehind example but does not work. It fails with the following message:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>.
Any help would be greatly appreciated. Thanks.
file: index.aspx
<%@ Page language="vb" debug="true"%>
<%@ Register TagPrefix="ncwc" Namespace="Nevron.Chart.WebForm" Assembly="Nevron.Chart.WebForm" %>
<%@ Import namespace ="System.Drawing"%>
<%@ Import namespace ="Nevron.UI.WebForm.Controls"%>
<%@ Import namespace ="Nevron.Chart.WebForm"%>
<%@ Import namespace ="Nevron.Chart"%>
<%@ Import namespace ="Nevron"%>
<%@ Import namespace ="Nevron.GraphicsCore"%>
<html>
<body>
<table>
<td>
<%
'create chart control
Dim nChartControl1 As NChartControl = New NChartControl
nChartControl1.Page = Me
nChartControl1.Width = 300
nChartControl1.Height = 300
'clear panels
nChartControl1.Panels.Clear()
'set background gradient
nChartControl1.BackgroundStyle.FillStyle = New NGradientFillStyle(Color.White, Color.Black)
'create gauge
Dim RadialGauge As New NRadialGaugePanel
nChartControl1.Panels.Add(RadialGauge)
'create needle
Dim NeedleIndicator As New NNeedleValueIndicator
RadialGauge.Indicators.Add(NeedleIndicator)
NeedleIndicator.Value = 25
Dim writer As HtmlTextWriter = New HtmlTextWriter(Page.Response.Output)
nChartControl1.RenderControl(writer)
Page.Controls.Add(nChartControl1)
%>
</td>
</table>
</body>
</html>