DynamicField.UIHint DynamicField.UIHint DynamicField.UIHint DynamicField.UIHint Property

定義

取得或設定要用於顯示資料欄位的欄位樣板。Gets or sets the field template to use for displaying the data field.

public:
 virtual property System::String ^ UIHint { System::String ^ get(); void set(System::String ^ value); };
public virtual string UIHint { get; set; }
member this.UIHint : string with get, set
Public Overridable Property UIHint As String

屬性值

要用於顯示資料欄位的欄位樣板名稱。The name of the field template to use for displaying the data field.

備註

UIHint使用屬性, 即可指定要用來顯示資料欄位之 UI 的欄位範本。Use the UIHint property to specify the field template to use to display the UI for a data field. 欄位範本預設為使用者控制項, 其名稱包含尾碼, 用以識別用於編輯作業和插入作業的欄位範本。Field templates by default are user controls and their names contain a suffix to identify field templates that are used for edit operations and insert operations. 尾碼分別為 [編輯] 和 [_insert]。The suffixes are _edit and _insert, respectively. 當您將值設定為UIHint屬性時, 您可以設定不含尾碼的名稱。When you set a value to the UIHint property, you set the name without the suffixes. 動態資料將識別資料欄位的目前模式, 並將轉譯正確的欄位範本。Dynamic Data will identify the current mode of the data field and will render the correct field template.

如果未設定屬性, 動態資料預設會根據欄位類型來轉譯欄位範本。 UIHintIf the UIHint property is not set, Dynamic Data by default will render the field template based on the field type. 如需詳細資訊, 請參閱ASP.NET 動態資料的樣板。For more information, see ASP.NET Dynamic Data Scaffolding.

您使用UIHint屬性指定的欄位範本, 是這個DynamicField類別實例特有的。The field template that you specify using the UIHint property is specific to this instance of the DynamicField class. 您也可以藉由UIHintAttribute將套用至資料模型, 在整個應用程式中變更資料欄位所使用的欄位範本。You can also change the field template used by a data field across the entire application by applying the UIHintAttribute to your data model. UIHint設定屬性會覆寫套用至資料模型的中繼資料。Setting the UIHint property overrides the metadata applied to the data model. 如需中繼資料屬性的詳細資訊, 請參閱ASP.NET 動態資料For more information about metadata attributes, see ASP.NET Dynamic Data.

當設定OnFieldChanged 屬性時,會呼叫方法來引發UIHint狀態變更事件。The OnFieldChanged method is called to raise a state change event when the UIHint property is set.

UIHint屬性的值會儲存在 view 狀態中。The value of the UIHint property is stored in view state.

適用於

另請參閱