前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用MagicAjax 实现无刷新Webparts

使用MagicAjax 实现无刷新Webparts

作者头像
张善友
发布2018-01-19 14:47:37
1.6K0
发布2018-01-19 14:47:37
举报
文章被收录于专栏:张善友的专栏张善友的专栏

介绍MagicAjax Web.config的配置如下:

<?xml version="1.0"?>
<configuration>
 <configSections>
  <section name="magicAjax" type="MagicAjax.Configuration.MagicAjaxSectionHandler, MagicAjax"/>
 </configSections>
 <magicAjax tracing="false">
  <pageStore/>
 </magicAjax>
 <system.web>
  <authentication mode="Forms"/>
  <pages>
  <controls>
  <add namespace="MagicAjax.UI.Controls" assembly="MagicAjax" tagPrefix="ajax"/>
  </controls>
  </pages>
<webParts>
  <personalization defaultProvider="Nsquared2SqlPersonalizationProvider">
  <authorization>
  <allow users="*" verbs="enterSharedScope"/>
  </authorization>
  <providers>
  <add name="Nsquared2SqlPersonalizationProvider" type="Nsquared2.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, Nsquared2.Web" connectionStringName="PortalConnectionString" varyByParams="ParentDPID,DPID,UserId"></add>
  </providers>
  </personalization>
  </webParts>  <httpModules>
  <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/>
  </httpModules>
  <compilation debug="true">
  <assemblies>
  <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
 </system.web>
</configuration>

使用WebPart的页面如下:

<asp:WebPartManager ID="WebPartManager1" runat="server">
            </asp:WebPartManager>
            <ajax:AjaxPanel ID="AjaxPanel1" runat="server" Height="305px" Width="452px">
            <wmz:WebPartDisplayModesMenu ID="WebPartDisplayModesMenu1" runat="server" />
            <table style="width: 505px">
                <tr>
                    <td>
                        <asp:WebPartZone ID="WebPartZone1" runat="server">
                            <ZoneTemplate>
                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                            </ZoneTemplate>
                        </asp:WebPartZone>
                    </td>
                    <td style="width: 280px">
                        <asp:WebPartZone ID="WebPartZone2" runat="server">
                            <ZoneTemplate>
                                <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
                            </ZoneTemplate>
                        </asp:WebPartZone>
                    </td>
                </tr>
            </table>
        </ajax:AjaxPanel>

把两个WebPartZone放在 MagicAjax's AjaxPanel.控件中,可以支持所有的WebPart的所有操作无刷新,类似于Google的Loading……效果。具体的例子参看MagicAjax's提供的例子。例子中包含了一个使用WebPart的例子。

参看在线演示http://demo2.magicajax.net/examples/WebParts.aspx

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2006-01-19 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档