MVC 中静态文件部分动态化

<div id="loginInfo">
    @Ajax.ActionLink("Test", "LoginInfo", null, new AjaxOptions()
{
    HttpMethod = "GET",
    UpdateTargetId = "loginInfo",
    InsertionMode = InsertionMode.Replace

},
new { id = "updatedLink" }
)
</div>
<script src="http://www.cnblogs.com/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="http://www.cnblogs.com/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="http://www.cnblogs.com/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="http://www.cnblogs.com/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#updatedLink").click();
    });

</script>

原理:在HTML document在本地加载完成后,触发事件更新动态内容

posted on 2012-07-08 23:29  笑东风  阅读(229)  评论(0编辑  收藏  举报

导航