简体   繁体   English

HTML的long属性值

[英]long attribute value of HTML

I am wondering why some of the tags attribute values have such a long string of values, such as 我想知道为什么某些标签属性值具有如此长的值字符串,例如

<script src="default.aspx?_TSM_HiddenField_=ctl00_sm1_HiddenField&amp;_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.51116.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3afd384f95-1b49-47cf-9b47-2fa2a921a36a%3a475a4ef5%3aeffe2a26%3a7e63a579%3a5546a2b%3ad2e10b12%3a37e2e5c9%3a1d3ed089%3a497ef277%3aa43b07eb%3a751cdd15%3adfad98a5%3a3cf12cf1%3a5a682656%3abfe70f69" type="text/javascript"></script>

or sometimes the id of a tag has a long string of value too. 有时标签的ID也包含一长串值。

why is that? 这是为什么? is that correct or normal? 那是正确还是正常? is that possible to decrease the size of that attribute so that i can somehow lower the load of server when it loads the page? 是否有可能减少该属性的大小,以便我可以以某种方式降低服务器在加载页面时的负载?

why is that? 这是为什么?

Because a bunch of state data is being passed to the server 因为一堆状态数据正在传递到服务器

is that correct 那是对的吗

Yes

or normal? 还是正常?

For ASP.NET it is 对于ASP.NET,它是

is that possible to decrease the size of that attribute so that i can somehow lower the load of server when it loads the page? 是否有可能减少该属性的大小,以便我可以以某种方式降低服务器在加载页面时的负载?

Possible? 可能? Yes. 是。 Easy? 简单? Probably not as it looks like it does stuff deep inside ASP.NET. 可能不是因为它看起来确实在ASP.NET内部。

The effort involved (both in writing the code to do so and running it) won't be worth it. 所付出的努力(包括编写代码和运行代码)都不值得。 It does not take a great deal of server resource to parse a 400 character query string. 解析400个字符的查询字符串并不需要大量的服务器资源。

If you mean why does ASP.NET bloat html with long attributes or Ids, that's how web forms works, it's ugly but don't worry about your server load. 如果您是说为什么ASP.NET bloat html具有长属性或Ids的原因,那就是Web表单的工作原理,虽然很丑陋,但是不必担心服务器负载。

You can control the way Ids are assigned to controls by changing the ClientIDMode property. 您可以通过更改ClientIDMode属性来控制将ID分配给控件的方式。

对于您的问题,我不是100%肯定的,但是不必太担心,因为那部分字符对负载的影响是可以忽略的(除非您在烤面包机上运行网站)。

I believe that this is affecting the script tags exclusively. 我相信这会专门影响脚本标签。 It seems that you are using Telerik' RadScriptManager's Combining Scripts feature . 似乎您正在使用Telerik的RadScriptManager的“合并脚本”功能

If you want to reduce the size of the tags (which is not a real problem), you might disable the feature. 如果要减小标签的大小(这不是真正的问题),则可以禁用该功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM