. NET 2.0Then, you can use the webresource attribute to write the server control to implement self-contained resource files in the control.
The procedure is as follows:
1. Use the webresource attribute to include the resource files required by the control to the control. resource files include: *. HTC, *. CSS, *. GIF, *. jpg, and so on.
Resource files are global variables and can be used by each control within the entire project assembly. Therefore, we can include the webresouce attribute in the assemblyinfo. VB file of the project.
2. Set the properties of the resource file and set the "generate operation" to "checked in resources" to generate the resource file to the DLL file during compilation.
3. Pay attention to the properties of the project where the control is located. If the project property does not specify the root namespace
Webresource only needs to be followed by the file name, for example: <Assembly: webresource ("projddtree. HTC", "text/X-component")>
If the project attribute specifies the root namespace, you must: <Assembly: webresource ("namespace. projddtree. HTC", "text/X-component")>
4. How to call resource files in controls