.NET的改动元素的ID [英] .Net Changes the element IDs

查看:147
本文介绍了.NET的改动元素的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET是好心通过附加ct100_他们改变我的网页上的元素ID。虽然我AP preciate微软想帮我,从我的网站上复制IDS留着,我想我可以管理它在我自己的。谁能告诉我如何prevent呢?
先谢谢了。

.Net is kindly changing the element ids on my pages by appending a ct100_ to them. As much as I appreciate microsoft trying to help me keep from duplicating ids on my site, I think I can manage it on my own. Can anyone tell me how to prevent this? Thanks in advance.

推荐答案

您将需要:

覆盖常规控制的行为从Control.ID属性
解耦Control.UniqueID财产
重写命名容器控件,使我们能够控制ID生成是怎么做的,以及如何找到一个控制

You will need to:
override regular controls' behavior to decouple the Control.UniqueID property from the Control.ID property
override naming container controls to allow us to control how ID generation is done and how to find a control

参考文献:

<一href=\"http://nunogomes.net/post/2008/06/02/ASPNET-Controls-Improving-automatic-ID-generation-Architectural-Changes-%28-Part-3%29.aspx\" rel=\"nofollow\">http://nunogomes.net/post/2008/06/02/ASPNET-Controls-Improving-automatic-ID-generation-Architectural-Changes-(-Part-3).aspx



<一href=\"http://weblogs.asp.net/nunogomes/archive/2008/06/04/asp-net-controls-improving-automatic-id-generation-architectural-changes-part-3.aspx\" rel=\"nofollow\">http://weblogs.asp.net/nunogomes/archive/2008/06/04/asp-net-controls-improving-automatic-id-generation-architectural-changes-part-3.aspx



http://forums.asp.net/t/1394822.aspx


这篇关于.NET的改动元素的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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