Copied to clipboard

Flag this post as spam?

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


  • Janet Kirklen 101 posts 200 karma points
    Sep 18, 2012 @ 17:20
    Janet Kirklen
    0

    Multiple Textstring Error: 'string' does not contain a definition for 'InnerText'

    I have used the Multiple Textstring datatype on other sites and not had any issues with it.  However, on one site I am getting the following error:

    Error Loading Razor Script (file: ) 'string' does not contain a definition for 'InnerText'    at CallSite.Target(Closure , CallSite , Object )
      at ASP._Page_App_Data_TEMP_Razor_inline_5c6810aa18a650d7a98ff0f412f12d66_cshtml.Execute() in d:\Websites\C149392\ccmgatx.org\wwwroot\App_Data\TEMP\Razor\inline-5c6810aa18a650d7a98ff0f412f12d66.cshtml:line 3
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
      at System.Web.WebPages.WebPage.ExecutePageHierarchy()
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)

    This site is Umbraco 4.7.2 and i am using uComponents 4.1.0.

    The code that generated this error is:

      <ul>
              @foreach (var x in Model.varieties) {
                <li>@x.InnerText</li>
              }
            </ul>

    I've uninstalled and re-installed uComponents and still have this issue.  With the same code on other 4.7.2 sites this works fine. 

    Is there something else in the uComponent or Umbraco code or core that could be causing this?

     

     

  • Lee Kelleher 3699 posts 13517 karma points admin core mvp c-trib
    Sep 18, 2012 @ 17:27
    Lee Kelleher
    0

    Hi Janet,

    Quickest solution is to remove the ".InnerText" and just use "@x".

    Longer answer, with fallback solution: The package installer does have an option to disable the Razor Model Binding, which was a new feature (in v4.0).  The Razor engine is able to cast the data-type values into strongly-type models, for easier access/use.   The side-effect of this is that existing Razor scripts would most likely break.

    To disable that functionality, add this option to your Web.config's AppSettings:

    <add key="ucomponents:RazorModelBinding" value="false" />

    Cheers, Lee.

  • Janet Kirklen 101 posts 200 karma points
    Sep 18, 2012 @ 23:21
    Janet Kirklen
    0

    Thank you for the quick answer Lee.   After percolating on this a bit I decided to back up my /bin folder up on the server and recopy the .dlls from my local instance of this same project up to the server.  This seems to have done the trick and my script is working now.  Not sure which .dll was the culprit.  If I run into this again maybe I'll try and figure that out. 

Please Sign in or register to post replies

Write your reply to:

Draft