zoukankan      html  css  js  c++  java
  • How to: Hide Collection Properties in an Edit Mode Detail View for an ASP.NET Application 如何:在编辑模式详细信息视图中隐藏集合属性(ASP.NET应用程序)

    This topic demonstrates how to change ASP.NET application behavior with respect to the display of nested List Views, so that collection properties are edited in the View mode and are hidden in Edit mode.

    本主题演示如何在嵌套列表视图的显示方面更改ASP.NET应用程序行为,以便在"视图"模式下编辑集合属性并在"编辑"模式下隐藏。

    Note 注意
    In this topic, the behavior is changed globally, for the entire application. To change the behavior for each Detail View individually, use the IModelDetailViewWeb.CollectionsEditMode property in the Model Editor instead.
    在本主题中,行为将全局更改,用于整个应用程序。要单独更改每个细节视图的行为,请改用模型编辑器中的 IModel 详细信息视图Web.集合编辑模式属性。

    In ASP.NET Web XAF applications, Detail Views have two modes of operation - View and Edit. By default, when you click an object in a List View, a corresponding Detail View is first opened in View mode. Then, you can use the SwitchToEditMode Action to switch the Detail View to Edit mode. If the object displayed by the Detail View has collection properties, these properties are displayed in both View and Edit modes. Collection properties are editable in Edit mode and read-only in View mode.

    在ASP.NET Web XAF 应用程序中,详细视图具有两种操作模式 - 查看和编辑。默认情况下,当您单击列表视图中的对象时,将首先在视图模式下打开相应的"详细信息视图"。然后,您可以使用"切换到编辑模式"操作将"详细信息视图"切换到"编辑"模式。如果"详细信息视图"显示的对象具有集合属性,则这些属性以"视图"和"编辑"模式显示。集合属性在"编辑"模式下可编辑,在视图模式下可只读。

    WebCollectionsMode_Edit

    This behavior is provided by the ShowViewStrategy used by default in ASP.NET applications. The Show View Strategy has two modes of operation.

    • Edit - In this mode, collection properties are always displayed in a Detail View, but can only be modified when the Detail View is in Edit mode. This is default behavior.
    • View - In this mode, collection properties are not displayed when a Detail View is in Edit mode, and can be modified only when the Detail View is in View mode.

    此行为由默认情况下在ASP.NET应用程序中使用的 ShowView 策略提供。显示视图策略有两种操作模式。

    • 编辑 - 在此模式下,集合属性始终显示在"详细"视图中,但只能在"详细"视图处于"编辑"模式时修改。这是默认行为。
    • 视图 - 在此模式下,当"详细视图"处于"编辑"模式时,不会显示集合属性,并且只有在"详细视图"处于"视图"模式时才能修改。

    The default behavior can be inconvenient in certain scenarios. To change the Show View Strategy mode of operation to View, open the Model Editor for the ASP.NET module or application project, focus the Options node and change the IModelOptionsWeb.CollectionsEditMode value.

    在某些情况下,默认行为可能不太方便。要将"显示视图策略"操作模式更改为"查看",请打开ASP.NET模块或应用程序项目的模型编辑器,聚焦选项节点并更改 IModelOptionsWeb.集合编辑模式值。

    CollectionsEditMode

    As a result, collection properties are not displayed in Edit mode. Instead, they are displayed and can be modified in View mode.

    因此,集合属性不会显示在"编辑"模式下。相反,它们会显示,并可以在"视图"模式下进行修改。

    WebCollectionsMode_View

     
  • 相关阅读:
    叙旧
    注册表的基本操作(.Net)
    如何自己实现 JavaScript 的 new 操作符?
    装饰者模式和TypeScript装饰器
    彻底弄懂GMT、UTC、时区和夏令时
    Javascript 中 cookie 操作方式
    javascript实例教程:使用canvas技术模仿echarts柱状图
    实现memcached客户端:TCP、连接池、一致性哈希、自定义协议
    Linux终端快速检测网站是否宕机的6个方法
    爬虫是什么吗?你知道爬虫的爬取流程吗?
  • 原文地址:https://www.cnblogs.com/foreachlife/p/How-to-Hide-Collection-Properties-in-an-Edit-Mode-Detail-View-or-an-ASP-NET-Application.html
Copyright © 2011-2022 走看看