本文介绍了计数custon控件并添加到javascript中的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们.

假设我有一个自定义控件.我在页面中添加了这个拖曳控件.
现在,我想在自定义控件类中编写JavaScript,以访问此控件并将其添加到数组中.

例如.
如果您在页面上拖动两个RequiredFieldValidator控件并在viewsource中检查javascript,您将看到类似以下脚本的内容.

Hi friends.

Suppose, I have one custom control. I add this tow control in the page.
Now, I want to write javascript in custom control class that access this controls and add into array.

For example.
If you take tow RequiredFieldValidator control on the page and check javascript in viewsource, You will see something like below script.

<script type="text/javascript">
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("req1"), document.getElementById("req2"));
//]]>
</script>



RequiredFieldValidator1控件ID为req1和
RequiredFieldValidator2控件ID为req2,并且两个控件都添加到Array中.

谢谢
英兰汉

编辑TR:请使用< pre>标签来格式化您的代码.



RequiredFieldValidator1 control Id is req1 and
RequiredFieldValidator2 control id is req2 and both controls are added into Array.

Thanks
Imrankhan

Edit TR : Please use <pre> tags to format your code.

推荐答案



这篇关于计数custon控件并添加到javascript中的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 09:35