Simple edit question

Vote:
 

Hi,

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.

 

#69853
Apr 08, 2013 14:09
Vote:
 

Hi

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); 

Regards

Per Gunsarfs

EPiServer Development Team

#69858
Apr 08, 2013 15:28
Vote:
 

Thanks Per!

#69884
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.