Copied to clipboard

Flag this post as spam?

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


  • William Chang 6 posts 26 karma points
    Jun 29, 2011 @ 20:03
    William Chang
    0

    Missing IsPost, Html.Raw, RenderPage, Href in VS Web Application

    I'm exclusively using Razor on  Umbraco 4.7.0 and the documentations (from this Wiki and Google) on how to configure your Visual Studio using Web Application project are sparse. After hours of searching and frustration, I cannot use the standard Razor properties and methods like "IsPost, Html.Raw, RenderPage, Href" because I keep getting errors and no autocomplete in Visual Studio?

    Please help.

    <configuration>
      <configSections>
        <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
          <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
        </sectionGroup>
      </configSections>
    
      <system.web>
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
    
          </assemblies>
          <buildProviders>
            <add extension=".cshtml" type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines"/>
          </buildProviders>
        </compilation>
    
        <pages>
          <controls>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="umbraco" namespace="umbraco.presentation.templateControls" assembly="umbraco"/>
          </controls>
        </pages>
      </system.web>
    
      <system.web.webPages.razor>
        <host factoryType="umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines"/>
        <pages pageBaseType="umbraco.MacroEngines.DynamicNodeContext">
          <namespaces>
            <add namespace="Microsoft.Web.Helpers"/>
            <add namespace="umbraco"/>
            <add namespace="Examine"/>
            <add namespace="umbraco.MacroEngines"/>
            <add namespace="MindComet"/>
            <add namespace="MindComet.Web.Helpers"/>
          </namespaces>
        </pages>
      </system.web.webPages.razor>
    </configuration>
    
    Thank you,
    Will
  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    Jul 01, 2011 @ 16:58
    Sebastiaan Janssen
    0

    In appSettings you're missing:    

    <add key="webpages:Enabled" value="true" />
    <add key="enableSimpleMembership" value="false" />
    <add key="autoFormsAuthentication" value="false" />

    Other than that it looks good. Have you tried a clean install of 4.7 (sounds like you're doing an upgrade)?

    What errors are you getting (or what indicates that it's not working)?

  • William Chang 6 posts 26 karma points
    Jul 05, 2011 @ 19:40
    William Chang
    0

    Thank you Sebastiaan Janssen. I'm not doing an upgrade, a fresh install of Umbraco 4.7.0 and a new VS project to build DLL files. My "Visual Studio 2010 Web Application Project" project finally recognize Razor more (e.g. IsPost, RenderPage) and the Razor warnings are gone from the "Error List" panel.

    The other errors I'm getting is related to the "asp" control tags:

    Element 'placeholder' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
    
    Attribute 'recursive' is not a valid attribute of element 'item'.
    Unrecognized tag prefix or device filter 'asp'.

    Here is my web.config, part of it:

        <pages>
          <controls>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="umbraco" namespace="umbraco.presentation.templateControls" assembly="umbraco"/>
          </controls>
        </pages>

    Please help. Thank you.

Please Sign in or register to post replies

Write your reply to:

Draft