Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

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.
Posted

1 solution

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[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900