关于asp.net结合jquery时服务器控件id的解决办法

using your example:
<input name="ctl00$ContentPlaceHolder1$myTextBox"
type="text" id="ctl00_ContentPlaceHolder1_myTextBox" />

I use this to find the items i need.

$("input[id*='myTextBox']").

from Jquery.com "Matches elements that have the specified attribute and it contains a certain value."
docs.jquery.com/.../attributeContains

This way i don't have to inject server code. Also i can keep my javascript in a seperate js file with out dirtying up the design HTML code. Also I don't have to ad any attributes that aren't standard.
posted @ 2009-09-17 21:43  shiningrise  阅读(535)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css