In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail about the Web Resources management model provided by ASP.NET 2.0. the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Web Resources management model provided by ASP.NET 2.0
ASP.NET (1.0 + 1.1) provides us with a programming model for developing WebControl, so we get rid of the reuse of include patterns in asp. However, 1.0 image 1.1 provides the Web control development model for dealing with components without image, css and other external resources is quite handy, although script is often an external resource, but in the development of controls we are used to using Page.Register...Script () to embed the module, because compact things are easier for us to reuse, with a dll can solve the problem why bother?
The Web Resources management model provided by ASP.NET 2.0 well solves the management problems of external resources such as image, css, script and so on. Now you just need to set the build action property of the resource file to Embedded Resource in solution explorer. Then add a sentence to assemblyinfo.cs:
[assembly: WebResource ("WebCtrl.cutecat.jpg", "image/jpg")]
We can see the parameter description of Web Resource in msdn: * is the name of the resource, and the second is the mime-type name of the resource.
Then call the following in the program:
M_Image.ImageUrl = this.Page.GetWebResourceUrl (typeof (WebCustom), "WebCtrl.cutecat.jpg")
The * parameter of GetWebResourceUrl is the user-defined type (this is used to determine the assembly), and the second parameter is the resource name.
The code returned to browser by the above statement is:
Src is returned after GetWebesourceUrl is executed, and it has three parameters (& here & is parsed to &, but IIS also recognizes it), * the parameter an is the name of the assembly determined by typeof (WebCustom), the second parameter r is obviously the name of the resource, and the third parameter t is the timestamp of the assembly referred to by a. This t is so that references to resources can enjoy the optimization of browser cache, because IE has its own cache mechanism for the same url. Because this r is also the timestamp of the user's assembly file, if the user updates the code, t will change after recompilation, which ensures that the resources available to browser can be updated. If we can be sure that the embedded resource really doesn't need to be updated, we can write a type in bcl in typeof (), such as typeof (string), then it will only change this t after the freamwork upgrade.
So much for sharing the Web Resources management model provided by ASP.NET 2.0. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.