当前位置:首页 > 网络编程 > WEB编程 > ASP.net > Asp.net Mvc Pv4中使用AjaxHelper

Asp.net Mvc Pv4中使用AjaxHelper

点击次数:41 次 发布日期:2008-11-21 22:06:09 作者:源代码网
源代码网推荐

源代码网整理以下这个有点类似于UpdatePanel,首先要引用2个js一个是Microsoft Ajax Lib,一个是Mvc的Ajax新类

以下为引用的内容:

源代码网整理以下        CODE:
        <script src="/Content/MicrosoftAjax.js" type="text/javascript"></script>
        <script src="/Content/MicrosoftMvcAjax.debug.js" type="text/javascript"></script>

源代码网整理以下使用方法1

源代码网整理以下

以下为引用的内容:

源代码网整理以下         <%using (Ajax.Form("About", new AjaxOptions() {UpdateTargetId = "showdiv"})) { %>
        <%=Html.SubmitButton() %>
        <div id="showdiv"></div>
        <%} %>

源代码网整理以下这样就将其中的About这个Action显示在 了showdiv中

源代码网整理以下使用方法2

源代码网整理以下

以下为引用的内容:

源代码网整理以下    <%=Ajax.ActionLink("显示", "About", new AjaxOptions() {        UpdateTargetId = "showdiv"})%>

源代码网整理以下这样就可以通过一个连接直接显示了。

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华