Yes. Our JS components (ExSuite/JS library) are pure HTML5/JavaScript libraries, not ASP.NET or server-side controls, so they are fully framework-independent. ASP.NET is only used to serve the pages and has no direct impact on the components. The components work in any environment that can serve HTML and JavaScript, including ASP.NET, ASP.NET WebForms, PHP, Node.js, static HTML pages, etc.
You can follow the next instructions to get started:
Download the ExSuite/JS library from our website, using the link here
Extract the downloaded package and locate the JavaScript files for the components you want to use (each component has a lib folder with the necessary files)
Copy the required library files to your ASP.NET project (copy under wwwroot/lib or any folder you prefer, such as wwwroot/lib/exontrol or something similar and copy the lib files there)
Locate the .cshtml file or .aspx file where you want to use the component and include the necessary JavaScript files using the <script> tag such as:
After including the necessary files, you can initialize and use the components in your JavaScript code as you would in any HTML page. For example, you can create a new instance of a component and call its methods to configure it and add it to the page as shown bellow:
The sample code above creates a new instance of the Gantt component, sets some configuration options, and loads data from an XML file. Ensure that you copy the datasource.xml file to your project and update the path in the code if necessary. The exontrol.CC.Resize method is used to resize the component to fit the window size, you can adjust the size as needed.
Run your ASP.NET application and navigate to the page where you included the component. You should see the component rendered and functioning as expected.
Here's the entire index.cshtml file that you can use as a reference to test the component in an ASP.NET environment:
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<divclass="text-center"><h1class="display-4">Welcome</h1><p>Learn about <ahref="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p></div><scripttype="text/javascript"src="lib/exontrol.common.min.js"></script><scripttype="text/javascript"src="lib/exontrol.patch.min.js"></script><scripttype="text/javascript"src="lib/exontrol.menu.min.js"></script><scripttype="text/javascript"src="lib/exontrol.menu.def.js"></script><scripttype="text/javascript"src="lib/exontrol.tree.min.js"></script><scripttype="text/javascript"src="lib/exontrol.tree.def.js"></script><scripttype="text/javascript"src="lib/exontrol.gantt.min.js"></script><scripttype="text/javascript"src="lib/exontrol.gantt.def.js"></script><script>var oGantt = new exontrol.Gantt(
{
chart:
{
paneWidthLeft: 512,
},
data: "datasource.xml"
});
exontrol.CC.Resize(oGantt.Canvas, window.innerWidth, window.innerHeight);
</script>
The following picture shows the VS code editor with the above code:
The following picture shows the result of running the above code in an ASP.NET environment:
Yes. The ExSuite/JS library can be used on any web-application that runs on any browser that supports HTML5. The ExSuite/JS library is a standalone-library that's written from scratch using pure-Javascript. The ExSuite/JS library requires no third party-libraries or frameworks. Each components includes a init.htm file that shows the minimal code to insert the component to a HTML page.
If you are wondering on how to use the component, please check the exhelper/js tool, that helps you to find the answers and source code for tons of how to questions. For instance, please go to:
that shows questions and answers on how to use the exorgchart/js components. Click the middle panels (the code panel), so it gets the focus and press ALT + 3 to get the HTML page that generates the view.