skmMenu: An ASP.NET Menu Control

Menu.ScriptPath Property

Gets or sets the path to an external JavaScript file. If no external path is specified, the JavaScript is rendered by the control directly in the page.

public string ScriptPath {get; set;}

Remarks

It is highly recommended that you utilize an external JavaScript file, as it promises performance increases both for the client and server. The client can cache an external JavaScript file, thereby reducing the bandwidth needed to be downloaded. On the server side, using an external JavaScript file results in several dozen lines of JavaScript code not needing to be rendered.

To use an external JavaScript file, place the skmMenu.js file that was included in the download in a directory in your Web site. You can then set this property to the path of the skmMenu.js file.

Example

[C#] This example assumes that the skmMenu.js file was placed in the /scripts/ directory of your Web site.

            protected Menu myMenuControl;
            
            private void Page_Load(object sender, EventArgs e)
            {
              myMenuControl.ScriptPath = "/scripts/skmMenu.js";
              ...
            }
            

See Also

Menu Class | skmMenu Namespace