zoukankan      html  css  js  c++  java
  • DNN下布局用户控件以及设置页面跳转

    Adminlist.ascx 列表 右上角一个新建按钮,跳转到Admin.ascx编辑页面。 这两个用户控件的部署设置如下图。

    当然要发.ascx发布到服务器上的DesktopModules文件夹,DLL放在BIN目录下。

    在list页面新建跳转到Edit页面。在Edit点击取消按钮跳转到list页面。

    一个list和edit页面基本满足了一般的增删改差。

     -----------------------------------------------------------------------

    List:

     public partial class AdminList : PortalModuleBase, IActionable

    {

           
    //业务逻辑

             
    protected void lbtnNew_Click(object sender, EventArgs e)
            {
                Response.Redirect(EditPageUrl);
            }

            
    string EditPageUrl
            {
                
    get
                {
                    
    return EditUrl("AdminID");//control key
                }
            }
            
    #region IActionable Members

            
    public DotNetNuke.Entities.Modules.Actions.ModuleActionCollection ModuleActions
            {
                
    get
                {
                    
    //create a new action to add an item, this will be added to the controls
                    
    //dropdown menu
                    ModuleActionCollection actions = new ModuleActionCollection();
                    actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, 
    this.LocalResourceFile),
                        ModuleActionType.AddContent, 
    """", EditUrl(), false, DotNetNuke.Security.SecurityAccessLevel.Edit,
                         
    truefalse);

                    
    return actions;
                }
            }

            
    #endregion

    }

     Edit:在上图中需要设置Control key 为AdminID.唯一,这样方便在模块内部跳转。

        public partial class AdminEdit : PortalModuleBase
        {

            
    protected void btnCancel_Click(object sender, EventArgs e)
            {
                Response.Redirect(ListPageUrl);
            }
            
    string ListPageUrl
            {
                
    get
                {
                    DotNetNuke.Entities.Modules.ModuleController objModules 
    = new DotNetNuke.Entities.Modules.ModuleController();
                    
    int intTabID = objModules.GetModuleByDefinition(PortalSettings.PortalId, "AdminList").TabID;
                    
    return Globals.NavigateURL(intTabID);
                }
            }

        }

  • 相关阅读:
    Luogu1053 NOIP2005篝火晚会
    BZOJ2151 种树(贪心+堆+链表/wqs二分+动态规划)
    Luogu1155 NOIP2008双栈排序(并查集)
    Luogu1092 NOIP2004虫食算(搜索+高斯消元)
    Codeforces Round#516 Div.1 翻车记
    Luogu1731 NOI1999生日蛋糕(搜索)
    洛谷 P1379 八数码难题 解题报告
    洛谷 P2501 [HAOI2006]数字序列 解题报告
    洛谷 P3143 [USACO16OPEN]钻石收藏家Diamond Collector 解题报告
    洛谷 P2894 [USACO08FEB]酒店Hotel 解题报告
  • 原文地址:https://www.cnblogs.com/diego0404/p/1452473.html
Copyright © 2011-2022 走看看