Skip to content
Michael Kolarz edited this page Sep 20, 2011 · 1 revision

Allows using standard .NET resources mechanism. All resources are loaded on first usage using AJAX calls.

[Window("~/Examples/Resources.aspx")]
public class ResourcesPage : Window {
	//This attribute forces loading resources in single request at the beginning of function call.
	[LoadResources(typeof(Resource2), typeof(Resource3))]
	protected void Page_Load() {
		//Loading Resource2 and Resource3 in single AJAX request (LoadResources attribute).
		//Loading Resource1 in AJAX request (first usage of Resource1).
		Alert(Resource1.String1);
		//No action (resources already loaded).
		Alert(Resource2.One);
		//No action (resources already loaded).
		Alert(Resource2.Two);
		//No action (resources already loaded).
		Alert(Resource3.Three);
		//No action (resources already loaded).
		Alert(Resource3.Four);
		//No action (resources already loaded).
		Alert(Resource1.String2);
	}
}

Clone this wiki locally