.NET news » Search results
Search results for query "Control" (238):
Windows with C++: The Thread Pool Environment
Eye-Blink Driven Verbal Communication
gLabel - Custom Label with Special Effects (VB.NET)
Silverlight RIA Tasks 2: Dynamic View Models
Signature User Control: Graphics Programming in Smart Phones, PocketPCs, and PDAs
UI Frontiers: A Color Scroll for XNA
Accessing Embedded Resources through a URL using WebResource.axd
Many of the built-in ASP.NET server controls require additional, external resources in order to function properly. For example,
when using any of the ASP.NET validation controls, the
controls rely on a bevy of JavaScript functions to perform their client-side validation. While each validation control could
emit such script directly into the page's content, a more efficient approach would be to package these JavaScript functions into
an external JavaScript file and then include that file in the page using <script src="PathToExternalJavaScriptFile" type="text/javascript" >.
This would reduce the total page size and would allow the browser to cache the external JavaScript file (rather than having to
send the JavaScript code down to the browser on each and every page visit/postback).
Prior to ASP.NET 2.0, such external resources that needed to be accessible to the visitor's browser had to be implemented as
actual files on the file system. If you've worked with ASP.NET 1.x's validation controls, your pages have included a reference
to a JavaScript file /aspnet_client/system_web/version/WebUIValidation.js and there is an actual file
with that name residing in the web application's root. Such external resources hamper deployment - if you deploy your
application from the testing server to production, it's imperative that the production server have the same external resources
(WebUIValidation.js, in this case), in the same locations in the file system.
To remedy this, ASP.NET 2.0 allows for external resources to be embedded within the control's assembly and then be accessed
through a specified URL. With the external images, JavaScript files, CSS files embedded in the control's assembly,
deployment is a breeze, as all of the resources are now contained within the assembly (the .dll file).
There are no external resources whose file names and location on the file system must map up. Once embedded into the assembly,
these resources can be accessed from an ASP.NET 2.0 web page through a special URL (WebResource.axd)..


Syndicate