In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
There is not much useful information on the Internet. An excerpt from an e-book is as follows
The webControls configuration section has only one clientScriptsLocation attribute, which is used to specify the default storage path for ASP.NET client script. These files are the client-side features that are included in the ASPX pages generated by HTML code, such as intelligent navigation and client control validation.
The above code is the default content of. The content of clientScriptsLocation is used to search for included scripts. The aspnet_client folder is automatically generated when you install ASP.NET in the directory of the Web server. Two placeholders are used to represent the name of the subfolder, which is likely to change in a future version of ASP.NET. The first placeholder is always set to system_web. The second placeholder is the version number of the .NET Framework.
ASP.NET 4 does not use this folder to store client script files. Client script files are actually embedded in system.web assemblies in the form of resources. And injected into the page through webresource.axd HTTP handler.
You can use the client script folder to save script files for use by custom ASP.NET controls.
I feel that this has really been abandoned, and when I look at the webControlsSection class in the source code of .NET Framework4.6, I don't find any code calling this class. I have tried to drag a verification control RequiredFieldValidator in a WebForm page and added two references to js scripts in the generated html code.
It can be concluded that the script file has been embedded in the assembly and the corresponding resources are obtained through webresource.axd. In fact, the resources that can be embedded here refer not only to js, but also to image files.
Out of curiosity, I took a look at RequiredFieldValidator's code.
Found that there is a line of code that registers the js file.
So I tried it myself.
ClientScript is an instance of ClientScriptManager. The file name of js is js2.js. The default namespace for this assembly needs to be set before. The js2.js file is placed in the root directory of the website.
The properties of the file are set as follows
Run the page to see that the generated html has an extra reference to js
What is puzzling is why the js embedded in ValidatorBase does not need to be used without namespaces, and the examples on MSDN also add namespaces in a regular way. Is there any other way to give it a namespace?
But still a little unconvinced, see how to get the original aspnet_client, and then found that through aspnet_regiis, you can add aspnet_client. I tried to add it, but it didn't work. At first, I wondered if the webControls configuration of the configuration file would affect the name of the generated folder. Later, I found that I was wrong and still generated aspnet_client. It seems that it is still used in the .NET 1.0 version, and the subsequent versions will switch to webresource.axd. And now also use ASP.NET MVC, this belongs to the use of webForm, now I still feel that the js out not embedded in the assembly is still inconvenient, modified js and then to compile the code.
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.