the difference between ClientID and ID of web control

E4CAB753-B41A-48FE-A387-D60B9FCDABC5.PNG 立即下载
  Basically, The ID of web control should be used on server programming, and the ClientID should be used on Client, pretty basic. if you want to use the ID of web control on Client, you will find it doesn't work, because ASP.NET will not set it down to Client.
  and the ID maybe is not unique in a page, a simplest example is:
    1. create a web form and a web user control.
    2. create a button on the web user control, it's ID should be Button1.
    3. create a button on the web form, it's ID should be Button1 too.
    4. put the web user control on the web form, now, in this web form, we have two buttons which name are both "Button1".
    when we are programming on the server, I can use the Button1 to identify the button in web form and web user control both because they are in different scenario.
    But when in client, there's only one page, right? so ASP.NET will generate ClientID automatically so that they are different. If you view the source of the final page in web brower, you can find the Button in web user control's id property changed(I think it's exactly ClientID, not the ID what we discuss here) to WebUserControl1_Button1(in my project, maybe  different in your project, but the key is that it has been changed.)

  let me summarize where we are, the ID and ClientID of web control are different, ClientID unique in a web page, but ID not, because the "web page" is a Client term, right? when we are programming on server, we concentrate over web form, web control, commonly not web page. so if we want to operate control on client, for example: register a script to page using Register..... function to operate control on client, we should inject control's ClientID into script, not the ID.

ASTM D4583-21(2025).pdf ASTM D4583-21(2025) 立即下载

相关推荐

Streaming-Speech-Recognition-Privacy-Boundary-Auditor-v1.0-原创源码与文档.zip

原创 JavaScript 工程工具合集条目,包含完整源码、README、MIT License、原创与授权声明、3 项自动化测试、可复现合成示例、离线 HTML/JSON/SVG 报告和 1080×720 真实运行效果图。Node.js 18+ 可直接运行,零第三方运行依赖,适合开发者用于数据校验、工程审计、容量规划与交付复核。热点仅作为需求信号,不含榜单项目源码、模型权重、品牌素材或官方截图。

用jQuery访问ASP.Net WebControl丑陋的ClientID方法

<br /><br /><br />当我们制作Web页面时通常会在客户端使用JavaScript动态的更改一个控件的属性,举例:<html> <head> <script type="text/javascript"> $(document).ready(function () { $("#btnSubmitMessage").click(function () { $("#lblMessage").text($("#txtMessage").val()); }); });

i'm DiNK 2599

CAD+ËÃÊ×¶ÉÁ»»¼²¼É¼¼ÐÄÊÑ

CAD+ËÃÊ×¶ÉÁ»»¼²¼É¼¼ÐÄÊÑ

My namespace disappear in ASP.NET 2(beta2)?

   When you create your first ASP.NET 2.0 Web Page. You may say:"Oh!", theres no default namespace in your code-behind cs file? OK, lets add one, we think every object should be in one certain names

daidaoke2001的专栏 1119

Upgrading from ASP.NET 1.1 to 2.0

  Recently Im working on the stuff that upgrading a ASP.NET 1.1 project to ASP.NET 2.0(of course, I mean visual studio 2005 beta 2).  Before starting this stuff, my colleague in U.S and I both think

daidaoke2001的专栏 1088

JavaScript operators( from Javascrip: The definitive guide, 4th guide)

Table 5-1. JavaScript operators PAOperatorOperand type(s)Operation performed15L.object, identifierProperty access L[]array, integerArray index L( )function, argumentsFunction call Rnewconstructor call

daidaoke2001的专栏 1086

How does the certain version of a certain brower support the JavaScript Standard?(come from Javascript:The definitive guide, 4th

Table 1-2. Client-side JavaScript features by browser BrowserLanguageDOM capabilitiesNetscape 2JavaScript 1.0Form manipulation Netscape 3JavaScript 1.1Image rollovers Netscape 4JavaScript 1.2DHTML wit

daidaoke2001的专栏 1065

Uncle Chutney's ASP.NET articles

 The articles about ASP.NET written by Uncle Chutney are great, he explains common troubles and questions lot of programmers like me encounter and worried about, explian complex things using simply an

daidaoke2001的专栏 1027

C++ 智能指针:auto_ptr / unique_ptr / shared_ptr / weak_ptr 原理与使用

智能指针拷贝核心原理适用场景auto_ptr转移所有权废弃不要用unique_ptr❌禁止拷贝 ✅支持 move独占资源独占所有权,默认首选shared_ptr✅支持拷贝引用计数需要多指针共享资源weak_ptr不持有资源不增加计数解决 shared_ptr 循环引用编码建议:优先用unique_ptr;确需共享再选shared_ptr;存在双向引用 / 环形结构,配合weak_ptr。

dajuc的博客 290

技术转移机构如何高效评估技术成果的价值?.docx

技术转移机构如何高效评估技术成果的价值?

科技园区如何精准招引高潜力科创项目并提升招商效率?.docx

科技园区如何精准招引高潜力科创项目并提升招商效率?

高校如何提升科研项目评价的科学性与效率?.docx

科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。

国央企如何优化重大科技项目的决策与资源分配?.docx

科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。

4波气弦第四次论证:P vs NP.pdf

4波气弦第四次论证:P vs NP

【C语言基础】第三讲:分支和循环

内容概要:本文详细讲解了C语言中的分支与循环结构,涵盖if、if-else、switch、while、for、do-while等核心语法,并深入介绍逻辑操作符、关系操作符、条件操作符及break、continue、goto的使用方法。通过大量可直接运行的代码示例,帮助初学者掌握程序的流程控制。文章最后以“猜数字游戏”作为综合案例,融合随机数生成(rand/srand/time)、循环控制与分支判断,强化知识点的实际应用能力。同时提供多个课堂练习,如判断三角形、简易计算器、水仙花数、九九乘法表和最大公约数等,全面提升编程实践水平。; 适合人群:面向C语言初学者,尤其是刚接触编程或有一定基础、希望系统掌握流程控制结构的研发学习者;适合工作1年内的新人或计算机相关专业学生; 使用场景及目标:①系统学习C语言中分支与循环的核心语法及其执行机制;②理解并熟练运用条件判断、循环嵌套、流程跳转等编程技巧;③通过猜数字游戏等综合项目提升代码整合与逻辑设计能力; 阅读建议:建议边学边练,配合Visual Studio等开发环境动手调试文中所有代码,重点关注“悬空else”、“switch穿透”、“循环中的continue陷阱”等易错点,深入理解短路求值与goto的合理使用场景,确保理论与实践相结合。

20260707-NS1081芯片U盘量产工具MPTool+1.4.8

20260707-NS1081芯片U盘量产工具MPTool+1.4.8

上一篇: 汉武大帝和历史
下一篇: Upgrading from ASP.NET 1.1 to 2.0
daidaoke2001
博客等级 码龄25年 1粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值