如何使用jquery在母版页及其内容页面上查找所有标签 [英] How to find all label on master page and its content page using jquery

查看:71
本文介绍了如何使用jquery在母版页及其内容页面上查找所有标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我想在jquery的主页和内容页面上找到所有标签。我在主页和内容页面上使用的标签是asp.net标签。



谢谢,

解决方案

< blockquote>你可以使用



 var l = 


(#yourlabelid);





问题是如何获得标签ID。如果你的js和你的控件在同一个master \content页面上你可以使用



 var l = 


(#<%= YourControl.ClientID%>);





如果不是,则创建一个master \content页面上包含id的变量



 var myLabelId ='<%= YourControl.ClientID%>'; 





然后你可以在你的js中使用mylabelId



 var l = 


Hello All,

I want to find all label on my master page and content page in jquery. Labels which i am using on master page and content page are asp.net label.

Thanks,

解决方案

You can access them using

var l =


("#yourlabelid");



The issue is how you get the label id. If your js is on the same master\content page as your controls you can use

var l =


("#<%= YourControl.ClientID %>");



If it's not, then create a variable on your master\content page that contains the id

var myLabelId = '<%= YourControl.ClientID %>';



You can then use mylabelId in your js

var l =


这篇关于如何使用jquery在母版页及其内容页面上查找所有标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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