在usercontrol中使用Jquery并在页面中使用该用户控件中的3个 [英] using Jquery in usercontrol and using 3 of that user control in a page

查看:60
本文介绍了在usercontrol中使用Jquery并在页面中使用该用户控件中的3个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有一个带有Jquery和Json代码的用户控件
并且我想在一页中使用该用户控件的两个或树(在一页中使用3个用户控件实例)

jQuery代码在这种状态下不起作用


但没有用....!
我在做什么?

解决方案

您仍然可以将jQuery与多个实例一起使用.在调用jQuery方法时,请将受控ID(选择器)与jquery函数一起使用.确保已设置控件实例的唯一ID.


变量或函数的组合名,其中<%= control.clientID%>在一页中生成功能的重复名称


hi i have a user control with a Jquery and Json code
and I want to use two or tree of that user control in one page ( 3 instance of user control in one page)

the Jquery code don''t work in this state


but not worked....!
what am i doing?

解决方案

You can still use jQuery with multiple instances. While calling the jQuery methods use controld id (selector) with the jquery functions. Make sure the controls instance has unique id is set.


combine name of your variable or functions with <%=control.clientID%> to generate non duplicate name of functions in a one page


这篇关于在usercontrol中使用Jquery并在页面中使用该用户控件中的3个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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