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