Getting a previewable property value with UIHint.PreviewableText

You might have seen that the field “Name in URL” first gives you the value and the editor needs to click “change” to edit it.

You can also accomplish this on your normal string properties by using the UI Hint “previewabletext” (also found as the constant UIHint.PreviewableText).

[Display(Name = "My Property")]
public virtual string MyProperty { get; set; }

And it will look like this:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: