ASP.NET作INamingContainer - 可选prefixes [英] ASP.NET INamingContainer - Optional prefixes

查看:96
本文介绍了ASP.NET作INamingContainer - 可选prefixes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP.NET是否始终应用的 CT100 $ ... 的prefixes到元素ID,或者在某些情况下,它优化这个路程,如果该元素是保证唯一的反正。

Does ASP.NET always apply the "ct100$..." prefixes to element IDs, or in some cases does it optimize this away if the element is guaranteed unique anyways.

最近,我已经看到构建在ID prefixes不同施加,具有prefixes和一个不是一个而是从相同的源都衍生

Recently I have seen builds differing in the ID prefixes being applied, one having the prefixes and one not but both deriving from the same source.

谁能提供任何更详细的这一点,并在INamingContainers和ID生成的运作?

Can anyone provide any more detail this, and on the workings of INamingContainers and ID generation?

推荐答案

新的ASP.NET 4 ClientIDMode属性影响呈现的客户端ID。设置命名容器控件predictive是为了减少这个...静态需要确切的编号,并呈现到客户端,你必须要小心,以确保其唯一性。

The new ASP.NET 4 ClientIDMode property affects the client-side ID rendered. Setting the naming container control to Predictive is meant to cut down on this... Static takes the exact ID and renders to the client, which you have to be careful to ensure uniqueness.

当你使用一个命名容器(母版页也是一个命名容器),追加此不再ID,以保证唯一性;在.NET 4中,他们认为多一点这个,并添加像predictive和静态功能,以减少对ID的长度。

When you use a naming container (a master page is also a naming container), it appends this longer ID to ensure uniqueness; with .NET 4, they thought a little more about this and added features like Predictive and Static to cut down on the lengths of the IDs.

心连心。

这篇关于ASP.NET作INamingContainer - 可选prefixes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆