Profile Picture

nocodebehind help

Posted By Michael Sides 14 Years Ago
Author
Message
Michael Sides
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 1, Visits: 1

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>



Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Michael,

 

You should remove the Page.Controls.Add(nChartControl1) from the last row.

Please let us know if you managed to get things working and if you have any additional questions.

 

Kind regards,

Nevron Support Team



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic