Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ron G 41 posts 137 karma points
    Dec 07, 2015 @ 23:56
    Ron G
    0

    GetPropertyValue no longer available in Model.Content (v7.3.3)?

    Upgraded from 7.3.1 to 7.3.3 and most of my views are broken because:

    Model.Content.GetPropertyValue<string>("title")
    

    ...no longer works.

    I'm I doing something wrong? All I see that IPublishedContent has is 'GetProperty' and no longer has 'GetPropertyValue'.

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Dec 09, 2015 @ 07:42
    Marc Goodson
    100

    Hi Ron

    GetPropertyValue

    @using Umbraco.Web 
    

    to the top of your View it should be available once more.

    To save you having to add that at the top of every view, if you look inside the Views folder there should be an additional Web.Config file; inside which it will list all the namespaces to make available within Razor pages.

    Is it possible during the upgrade this got mangled some how ? Have a look see if it is there, and contains the list of default namespaces.

      <system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
          <namespaces>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="Umbraco.Web" />
            <add namespace="Umbraco.Core" />
            <add namespace="Umbraco.Core.Models" />
    <add namespace="Umbraco.Web.Mvc" />
        <add namespace="umbraco" />
            <add namespace="Examine" />
          </namespaces>
        </pages>
      </system.web.webPages.razor>
    
Please Sign in or register to post replies

Write your reply to:

Draft