Try our conversational search powered by Generative AI!

Simple edit question



I just noticed a thing while working with EPiServer. I had this line in a view:

<h1>@Html.PropertyFor(x => x.CurrentPage.Name)</h1>

Howcome this is not editable in Edit mode? I can't change the name property. But if I use 

<h1 class="arrow_down">@Html.PropertyFor(x => x.CurrentPage.PageName)</h1>

it is editable? Is the Name property some special property that should not be editable, and how is that set? I can't see any special attribute declared on it on PageData class.


Apr 08, 2013 14:09


This is a bug. It should be possible to do as your first example and get the name editable.

To workaround the bug, just do as you did in your second sample, and use PageName instead. The 'Name' property is backed by a PropertyString called PageName, so the fields are the same.

If you want to use the 'Name' property, you should be able to add an edit hint to work around the bug. Something like this:

ViewData.GetEditHints<MyPageViewModel, MyPage>().AddConnection(x => x.CurrentPage.Name, p => p.PageName); 


Per Gunsarfs

EPiServer Development Team

Apr 08, 2013 15:28

Thanks Per!

Apr 09, 2013 9:48
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.