Thanks, MorningZ. IDOverride seems a good option. I can't find too many discussions about Wilco's IDOverride from Internet. Will the modifcation of ClientId impact the postback event raising? I find of some warning about that. (LoadPostData, RaiseChangedEvent, IPostBackDataHandler issues)
On 12月26日, 上午9時14分, MorningZ <morni...@gmail.com> wrote: > No offense.. but that doesn't seem to elegant or useful of a > solution... > > if you have controls on a content page that are not in another > container (GridView, UserControl, etc etc), then Wilco Bawer's "ID > Override" is excellent.... one simple line of code keeps the ID of > <asp:TextBox id="TextBox1" /> as "TextBox1" > > http://wilcob.com/Wilco/Toolbox/WilcoWeb.aspx > > On Dec 25, 7:13 pm, Darkthread <darkthr...@gmail.com> wrote: > > > > > When you use MasterPage in ASP.NET, the webcontrol's clientid will be > > added with prefix of its container. TextBox1 will be rendered as > > <input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" > > id="ctl00_ContentPlaceHolder1_TextBox1" />, the id becomes > > ctl00_ContentPlaceHolder1_TextBox1, but not TextBox1, so you can't > > simply use $("#TextBox1") to find it. > > > Here is my idea to resolve this issue with $("._TextBox1") or $$ > > ("#TextBox1") syntax, for your reference. > > >http://blog.darkthread.net/blogs/darkthreadtw/archive/2008/12/26/reso...- > >隱藏被引用文字 - > > - 顯示被引用文字 -