$(document).ready() and partial view load

Posted by user252160 on Stack Overflow See other posts from Stack Overflow or by user252160
Published on 2010-04-10T18:35:04Z Indexed on 2010/04/10 18:43 UTC
Read the original article Hit count: 654

Filed under:
|
|

I am developing an application using Asp.net mvc and jquery. I'd like to use the same naming convention (classes and ids) for html elements in different views.

In case when I want to load a partial view asynchronously, the $(document).ready() piece of code in the main view loses its usefulness because none of the patial view's html tags and css naming is recognized by jquery. I certainly do not want to write the same code for every view. What's th ebest way to solve this issue?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about jQuery