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.
精彩评论