This example demonstrates how to create a web application with multiple pages by using multiple top-level WebVIs and Hyperlink controls to link between them. When you build the web application, each top-level WebVI generates a separate HTML file with links to the other HTML files that are generated.
MultipleTopLevelVIs/MultipleTopLevelVIs.gwebproject
WebApp.gcomp
and open index.gviweb
WebApp.gcomp
to open the web application component.You can manually the move the build output found at \MultipleTopLevelVIs\Builds
to any web server. This project also includes a Distribution (WebApp.lvdist
) that can be used to build a package (.nipkg). Packages utilize NI Package Manager to automated the process of installing, upgrading, or removing the web app. A package is also a requirement for hosting a Web application on SystemLink Cloud.
The following steps can be used to host the web app on SystemLink Cloud
MultipleTopLevelVIs.gwebproject
WebApp.lvdist
The following steps can be used to host the web app on a local web server
MultipleTopLevelVIs.gwebproject
WebApp.lvdist
http://localhost:9090/incorporateuserresources/
C:\Program Files (x86)\National Instruments\Shared\NI WebServer\www
WebApp_Default Web Server
directory into the www
directory.http://localhost:8080/WebApp_Default%20Web%20Server/
C:\Program Files\National Instruments\Shared\Web Server\htdocs
WebApp_Default Web Server
directory into the htdocs
directory.http://localhost:9090/WebApp_Default%20Web%20Server/
Each of the top-level WebVIs generates a corresponding HTML file. The organization of the generated HTML files mirrors the hierarchy of WebVIs marked as top-level in the WebApp.gcomp
file.
On the Item tab, you can change the file name for each WebVI and view the relative URL used for linking.
Top-level WebVIs do not need to be at the root of the namespace. For example, SubVIs/Attribution.gviweb
is marked as top-level and has a relative URL of SubVIs/Attribution.html
.