开发者

autoresize and asp.net

开发者 https://www.devze.com 2022-12-27 05:57 出处:网络
Why doesn\'t work my project.I want use jquery autoresizable for my asp.net textbox? Like thishttp://james.padolsey.com/javascript/jquery-plugin-autoresize/

Why doesn't work my project.I want use jquery autoresizable for my asp.net textbox?

Like this http://james.padolsey.com/javascript/jquery-plugin-autoresize/

This is code from master page..

http://www.djkbf.hr/~atokic/code.t开发者_Go百科xt


It is because your TextBox is inside a ContentPlaceHolder in the MasterPage. The ID gets modified when the page renders to something like ctl00_blah.

Try using a class selector instead like so:

$('textarea.jk').autoResize();

That should do the trick. In ASP.NET 4.0 you can force the ClientId to keep the name you specify, but I would just recommend using classes to make it easier. Another option would be to use ASP.NET to render the ClientId in the page like so:

$('textarea#<%=demo.ClientID %>').autoResize();
0

精彩评论

暂无评论...
验证码 换一张
取 消