创建文本框唯一的ID [英] Creating unique id for textbox

查看:87
本文介绍了创建文本框唯一的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢有唯一的ID为文本框和隐藏filds。就是有这将给唯一的ID在asp.net中任何财产?

i like to have unique ids for textboxes and hidden filds .is there any property which will give unique id in asp.net ?

< ASP:文本框的id =ctr001_1=服务器UNIQUEID =文本框/>

推荐答案

1日的事情,为什么你需要设置UniqueID属性?仅供参考,ASP.NET Web服务器控件都有自己的自动生成只读UniqueID属性,你可以在你的代码访问象下面这样:

1st thing, why do you need to set the UniqueID property? FYI, ASP.NET web server controls has its own auto-generated readonly UniqueID property that you can access in your coding like below:

Textbox1.UniqueID()

的UniqueID的是基于控制层次产生,并且每一个控制的UniqueID属性是,很明显的,独特的

The UniqueID is generated based on the control hierarchy, and each control's UniqueID property is, obviously, unique.

这篇关于创建文本框唯一的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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