开发者

ASP.Net MVC ParitalView and Javascript / jQuery?

Is it possible to have a PartialView execute the jQuery ready function on load of the PartialView. I do this all of the time in a regular View.

For example, I want to do something like this:

<%@ Control Language="C#" Inherits="Syst开发者_如何学Pythonem.Web.Mvc.ViewUserControl<MainConfig.Models.ProfileAddress>" %>

<script type="text/javascript">

     $(function () {        

        alert('I am in ProfileAddress PartialView');
     }

</script>

Partial View Html Code Here

Maybe I have to do something on the server side.

Please let me know.


Yes, it is possible. Your code will work as long as the partial view is rendered.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜