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);
                }
            }

        }

  • 相关阅读:
    python3+request接口自动化框架
    类型转换函数
    操作符重载(三)
    操作符重载(二)
    操作符重载(一)
    时间获取函数
    文件和目录
    Linux五种IO模型
    类中的函数重载
    系统调用IO和标准IO
  • 原文地址:https://www.cnblogs.com/diego0404/p/1452473.html
Copyright © 2011-2022 走看看