Search KB Filter article types
How to Add a Javascript Resource File to a Skinnable or Custom Control
Step by step - how to add a JavaScript resource file to a control
Categories: Custom Controls, Skinnable and Inherited Controls
Tags: Developers, JavaScript, 2. Intermediate, 3. Advanced, Customization, DHTML, v6.4 and Later
Revision: 1
Posted: 26/July/2011
Updated: 27/July/2011
Status: Publish
Types: Walkthrough

Overview

This article details how to properly add a JavaScript file resource to a current skinnable or custom Visual WebGui control.
If you do not already have a skinnable control and would like to create one, view this article here.
If you do not already have a custom control and would like to create one, view this article here.

Adding the File Through the Skin Designer

1. Build the project that contains the skinnable or custom control you wish to add the script resource to.
2. Right click on the control's skin class item in the Solution Explorter pane and select "View Designer".

3. Open the resource type drop-down on the top and select "Scripts".

4. Open the "Add Resource" drop-down and select "Add New..."

5. At this point you have a new resource file with a default name.
    You are allowed to change the default name, to make it correspond with other resources or any other reason.

Setting the script resource file properties

Select the script resource item of the file we just added on the Skin Designer.
You should be able to see that the PropertyGrid of ther properties pane reflects the properties of the selected resource item.

We now need to set the following properties accordingly:

  • ComplierActions: Set what the Visual WebGui resource complier should do with this resource. All three: "RemoveComments", "RemoveWhitespaces" and "ApplyObscuring" should be selected".
  • Presentation: The "Browser" option should be set as this resource is only relevant for a DHTML presentation layer.
  • PresentationEngine: This setting determines to what browser/s this resource file should be available. The default is "Agnostic" which means - to all. You can alternatively select specific browser types, as shown in the image below.
  • PresentationRole: Should be set to "BrowserCode". The other options are not relevant to script files.

 

Related Articles

 

About the author

Related Articles

Custom Controls  
Title Update Author
I played a bit around with the new 6.4 ListView control, its quite amazing what you can do with it. It opens a lot of new ways to present data in a better and more userfriendly way.
Tags: Architects, Developers, Data Binding, C#, 2. Intermediate, 3. Advanced, Customization, Data Binding, v6.4 and Later
05/Jan/2010    2010/01/05
In this How to we are going to learn the basic usage of Visual WebGui RIA Platform Theme & Control designer.
Tags: Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
04/Jan/2009    2009/01/04
Tags: Developers, Events, JavaScript, 1. Beginner, 2. Intermediate, Integration, Pre v6.3, v6.3, 3. Advanced
07/Jan/2007    2007/01/07
Tags: Developers, Events, JavaScript, 2. Intermediate, 3. Advanced, Integration, Pre v6.3, v6.3
11/Jan/2007    2007/01/11
Tags: Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
06/Jan/2009    2009/01/06
Tags: Developers, Events, JavaScript, 3. Advanced, Customization, v6.3
09/Jan/2009    2009/01/09
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS