开发者

JQuery is not working properly when embeded into a ASP.NET WebForm project

开发者 https://www.devze.com 2023-01-18 01:51 出处:网络
I\'m just using a simple slideToggle function of jQuery. It works properly in my HTML file. But whenever I take codes into a ASP.NET WebForm project, script doesn\'t work. I can\'t achieve slide effec

I'm just using a simple slideToggle function of jQuery. It works properly in my HTML file. But whenever I take codes into a ASP.NET WebForm project, script doesn't work. I can't achieve slide effect.

Is this a known issue? It's probably a popular mistake done by developers though. What could be the problem? Any possibilities?

开发者_开发知识库(I didn't copy&paste any code because of I thought this is not a specific situation, but I can show codes if you want)


I'm guessing this is due to the unpredictable IDs of ASP.NET elements; there is fixed naming available in 4.0 (ClientID) - try using that with your #foo selectors? (where ClientID is set to "foo")


Try using a class on the html element rather than using the id and update your selector to use the class.

0

精彩评论

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