DNN MVC模块缺少编辑选项

时间:2016-07-09 23:37:32

标签: dotnetnuke dotnetnuke-module

我的dnn mvc模块缺少编辑选项。通常你会得到铅笔图标进行编辑,见下面的图片

enter image description here

我正在使用Chris Hammond模板来处理我正在研究的MVC模块。

这是我的Module.dnn文件,如

<moduleControls>
    <moduleControl>
      <controlKey />
      <controlSrc>Abc.Controllers/Home/Index.mvc</controlSrc>
      <supportsPartialRendering>False</supportsPartialRendering>
      <controlTitle />
      <controlType>View</controlType>
      <iconFile />
      <helpUrl />
      <viewOrder>0</viewOrder>
    </moduleControl>
    <moduleControl>
      <controlKey>Edit</controlKey>
      <controlSrc>Abc.Controllers/Home/Edit.mvc</controlSrc>
      <supportsPartialRendering>False</supportsPartialRendering>
      <controlTitle>Edit Content</controlTitle>
      <controlType>Edit</controlType>
      <iconFile />
      <helpUrl />
      <viewOrder>0</viewOrder>
      <supportsPopUps>False</supportsPopUps>
    </moduleControl>
    <moduleControl>
      <controlKey>Settings</controlKey>
      <controlSrc>Abc.Controllers/Settings/Settings.mvc</controlSrc>
      <supportsPartialRendering>False</supportsPartialRendering>
      <controlTitle>FishProNews Settings</controlTitle>
      <controlType>Edit</controlType>
      <iconFile />
      <helpUrl />
      <viewOrder>0</viewOrder>
    </moduleControl>
  </moduleControls>
</moduleDefinition>

我有一个指向索引和编辑的家庭控制器,但由于我缺少编辑(铅笔图标),我无法测试编辑功能。

有人知道热得到编辑(铅笔图标)选项吗?

1 个答案:

答案 0 :(得分:3)

杰克,

“编辑”图标不是缺失选项。铅笔打开ModuleAction菜单,该菜单必须由模块开发人员实现。 Chris Hammond的模板应该在你的默认模块视图的(Home)Index动作上有一个装饰器。

[ModuleAction(ControlKey = "Edit", TitleKey = "AddItem")]
public ActionResult Index()
{
    // Return the view and model
}

ModuleAction装饰器会将一个项目添加到“铅笔”模块操作菜单中。 ControlKey引用要在清单文件中调用的操作的名称;即:“编辑”,它应该在您的家庭控制器中具有Edit.cshtml和编辑操作方法。 TitleKey是菜单的资源字符串。在App_LocalResources / Home.resx中,您可以添加一个资源字符串“AddItem.Text”,其值为“Add New Item”,例如。

你应该看到这样的事情:

enter image description here

要查看有效示例,请参阅我的RestaurantMenuMVC example project