404 error when using chart control


https://www.nevron.com/Forum/Topic12101.aspx
Print Topic | Close Window

By Mohammad Javahery - 7 Years Ago
Hi.
I am new to Nevron Vision for .Net. I am trying to generate a simple chart and these are codes used in ASP.NET and VB.NET parts:

ASP.NET:
<ncwc:NChartControl ID="PerOwnerRRR" runat="server" Width="420px" Height="320px"></ncwc:NChartControl>

VB.NET:
PerOwnerRRR.BackgroundStyle.FrameStyle.Visible = True

Dim title As NLabel = PerOwnerRRR.Labels.AddHeader("موجودی شرکت ها")

title.TextStyle.FontStyle = New NFontStyle("B Nazanin", 14, FontStyle.Italic)
title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur

Dim chart As NChart = PerOwnerRRR.Charts(0)

chart.Axis(StandardAxis.Depth).Visible = False

Dim linearScale As NLinearScaleConfigurator = TryCast(chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator, NLinearScaleConfigurator)
Dim stripStyle As NScaleStripStyle = New NScaleStripStyle(New NColorFillStyle(Color.Beige), Nothing, True, 0, 0, 1, 1)

stripStyle.Interlaced = True
stripStyle.SetShowAtWall(ChartWallType.Back, True)
stripStyle.SetShowAtWall(ChartWallType.Left, True)
linearScale.StripStyles.Add(stripStyle)

Dim barSeries As NBarSeries = CType(chart.Series.Add(SeriesType.Bar), NBarSeries)

barSeries.Name = "موجودی شرکت ها"
barSeries.DataLabelStyle.Format = "<value>"
barSeries.Legend.TextStyle.FontStyle.EmSize = New NLength(8, NGraphicsUnit.Point)
barSeries.ShadowStyle.Type = ShadowType.GaussianBlur
barSeries.ShadowStyle.Offset = New NPointL(New NLength(3, NGraphicsUnit.Pixel), New NLength(3, NGraphicsUnit.Pixel))
barSeries.ShadowStyle.Color = Color.FromArgb(80, 0, 0, 0)
barSeries.ShadowStyle.FadeLength = New NLength(5, NGraphicsUnit.Pixel)
barSeries.DataLabelStyle.Visible = True
barSeries.BarShape = BarShape.SmoothEdgeBar
For i = 0 To owners.Count - 1
barSeries.AddDataPoint(New NDataPoint(sums2(i), owners(i).Name))
Next
barSeries.Legend.Mode = SeriesLegendMode.DataPoints

Dim styleSheet As NStyleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor)

styleSheet.Apply(PerOwnerRRR.Document)

title.DockMode = PanelDockMode.Top
title.Padding = New NMarginsL(4, 6, 4, 6)
PerOwnerRRR.Legends(0).DockMode = PanelDockMode.Right
PerOwnerRRR.Legends(0).Padding = New NMarginsL(1, 1, 3, 3)
chart.BoundsMode = BoundsMode.Fit
chart.DockMode = PanelDockMode.Fill
chart.Padding = New NMarginsL(New NLength(3, NRelativeUnit.ParentPercentage), New NLength(3, NRelativeUnit.ParentPercentage), New NLength(3, NRelativeUnit.ParentPercentage), New NLength(3, NRelativeUnit.ParentPercentage))

Both parts are copy-pasted from examples accompanying installation source and configured according to my project. Sample website accompanying installation source works very well. But when I run my project, only a picture placeholder is displayed and browser (Google Chrome) says error 404 occurred loading resource (Image below)Both sums2 and owners lists contain 2 items at the time of test. Please help.

https://www.nevron.com/forum/uploads/images/22817c93-5cd5-4cce-af62-65b7.png

Thanks in advance.
By Mohammad Javahery - 7 Years Ago
I fixed it myself. The problem was in web.config. I hadn't had copied required tags.
By Nevron Support - 7 Years Ago
Hi Mohammad,

Just in case someone else has this problem the following http handlers must be present in the web.config in order for the control to function properly:

  <system.web>
    <httpHandlers>
      <add verb="*" path="NevronChart.axd" type="Nevron.Chart.WebForm.NChartImageResourceHandler" validate="false"/>
      <add verb="*" path="NevronScriptManager.axd" type="Nevron.UI.WebForm.Controls.NevronScriptManager" validate="false"/>
      <add verb="GET,HEAD" path="NevronPrinting.axd" type="Nevron.UI.WebForm.Controls.NPrintPreviewHttpHandler" validate="false"/>
      <add verb="GET,HEAD" path="NevronCustomTools.axd" type="Nevron.Examples.Chart.WebForm.NChartZoomHttpHandler" validate="false"/>
      <add path="NThinChartControlHttpHandler.axd" verb="*" type="Nevron.Chart.ThinWeb.NThinChartControlHttpHandler" validate="false"/>
      <add path="NAspNetThinWebControlHttpHandler.axd" verb="*" type="Nevron.ThinWeb.NAspNetThinWebControlHttpHandler" validate="false"/>
    </httpHandlers>
  </system.web>

.....

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <add name="NevronChart" preCondition="integratedMode" verb="*" path="NevronChart.axd" type="Nevron.Chart.WebForm.NChartImageResourceHandler"/>
      <add name="NevronScriptManager" preCondition="integratedMode" verb="*" path="NevronScriptManager.axd" type="Nevron.UI.WebForm.Controls.NevronScriptManager"/>
      <add name="NThinChartControlHttpHandler" preCondition="integratedMode" verb="*" path="NThinChartControlHttpHandler.axd" type="Nevron.Chart.ThinWeb.NThinChartControlHttpHandler"/>
      <add name="NAspNetThinWebControlHttpHandler" preCondition="integratedMode" verb="*" path="NAspNetThinWebControlHttpHandler.axd" type="Nevron.ThinWeb.NAspNetThinWebControlHttpHandler"/>

      <add name ="NPrintPreviewHttpHandler" preCondition="integratedMode" verb="GET, HEAD" path="NevronPrinting.axd" type="Nevron.UI.WebForm.Controls.NPrintPreviewHttpHandler"/>
      <add name ="NevronCustomTools" preCondition="integratedMode" verb="GET, HEAD" path="NevronCustomTools.axd" type="Nevron.Examples.Chart.WebForm.NChartZoomHttpHandler"/>

    </handlers>
  </system.webServer>