Toggle navigation Highcharts
  • About Us
    • About Us
    • Job Openings
    • Contact Us
    • News
    • Resellers
  • Home
  • Products
    • Highcharts
    • Highstock
    • Highmaps
    • Mobile
    • Highcharts Cloud
    • Highcharts Editor
    • Wrappers
    • Plugins
  • Demo
    • Highcharts demos
    • Highstock demos
    • Highmaps demo
  • Docs
    • General Documentation
    • API Reference
    • Changelog
    • Roadmap
  • Support
    • Support
    • Download
  • Blog
  • Community
    • Project Showcase
    • Chart Code Showcase
    • Contribute
  • Buy
  • About Us
    • About Us
    • Job Openings
    • Contact Us
    • News
    • Resellers
Highcharts .NET 
  • Highcharts .NET
  • Highstock .NET
Docs 
  • Demos
  • API
  • Docs
  • See on NuGet
  • Download 
  • Demo
  • API
  • Docs
  • See on NuGet
  • Download 
Highcharts .NET
 Highcharts  Highstock
  • System Requirements
    • Server-Side System Requirements
    • Client-Side System Requirements
  • Add Highcharts .NET Reference to Visual Studio
    • Visual Studio .NET
    • Other IDEs / Web Projects
  • Your first chart for MVC
    • Introduction
    • Add reference to the view
    • Include JavaScript files
    • Define the chart in the view
    • Add data
  • Your first chart for Web Forms
    • Introduction
    • Add User Control
    • Create and render chart
    • Add User Control to the web page
list

Add User Control to the web page.

Open the web page in this case Default.aspx, and follow the instructions bellow:

  1. Register HighchartsControl.
    <%@ Register TagPrefix="hc" TagName="Chart" Src="~/Controls/HighchartsControl.ascx" %>
  2. Include required Javascript files.
    
    <script src="https://code.highcharts.com/highcharts.js"></script>
    <script src="https://code.highcharts.com/modules/exporting.js"></script>
  3. Use HighchartControl.
    <hc:Chart runat="server"></hc:Chart>

Sample code below:

        
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication11._Default" %>
<%@ Register TagPrefix="hc" TagName="Chart" Src="~/Controls/HighchartsControl.ascx" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
        <script src="https://code.highcharts.com/highcharts.js"></script>
        <script src="https://code.highcharts.com/modules/exporting.js"></script>

        <hc:Chart runat="server"></hc:Chart>
</asp:Content>

© 2023 Highcharts. All rights reserved.