访问jQuery中的页面控件 [英] Access page controls in jquery

查看:77
本文介绍了访问jQuery中的页面控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在VS 2008中有一个Web应用程序.我使用jquery来验证不同的Forms,并将其用于其他目的.在VS 2008中,我获得了像Ctl001 _....这样的jquery中页面控件的ID,但是现在我已将该应用程序升级到VS 2010,现在我的所有页面控件在jquery中都出错了,因为它在那里将其ID更改为ContentBody_.. ...,我无法将所有这些都转换为新的前缀ContentBody _....,因为在服务器上,我的项目在.Net Framework 3.5上运行,并且ID带有Ctl001 _.....前缀. 任何人都可以告诉我一种无需依赖.Net Framework就可以轻松地在jquery中获取控件ID的方法.

任何帮助将不胜感激.



I have a web application in VS 2008. I used jquery for validation of different Forms and used it for other purposes. In VS 2008 I get the IDs of page controls in jquery like Ctl001_.... , but now I have upgraded the application to VS 2010 and now all my page controls are giving error in jquery because its changed its ID there as ContentBody_....., I can not convert all these to the new prefix ContentBody_.... because on the server my project runs on .Net Framework 3.5 and there the IDs are with the Prefix of Ctl001_....,
can any one tell me a way that I can easily get control''s ID in jquery without depending on the .Net Framework.

any help would be greatly appreciated.

推荐答案



升级到VS 2010后,可以升级到.NET 4吗?这有使用ClientIDMode属性指定客户端ID的不同方法.您可以在web.config中全局设置,也可以在逐个控件的基础上进行设置.

请查看此文章以了解不同的类型:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx [ ^ ]
Hi,

Having upgraded to VS 2010 can you upgrade to .NET 4? That has different ways of specifying the client IDs using the ClientIDMode property. You can either set this globally in the web.config or on a control by control basis.

Please see this article for the different types:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx[^]


这篇关于访问jQuery中的页面控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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