EXT.Net Razor WebPages @Html.X Helper not found v3.30

  1. #1

    EXT.Net Razor WebPages @Html.X Helper not found v3.30

    Hello,

    Am struggling to get an Ext.NET Razor webpages sample working. The test Visual Studio project I built is failing with the following:
    'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'X'

    My web Config is as follows:

    <configuration>
      <configSections>
        <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false"/>
      </configSections>
    
      <extnet theme="Crisp" initScriptMode="Linked"/>
    
      <appSettings>
        <add key="webpages:Version" value="3.0.0.0"/>
        <add key="ClientValidationEnabled" value="true"/>
        <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
        <add key="LocalLogging" value="False"/>
      </appSettings>
    
      <system.web>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.5">
          <assemblies>
          <add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="Ext.Net"/>
          </assemblies>
        </compilation>
        <httpRuntime targetFramework="4.5" 
                     enableVersionHeader="false" 
                     requestValidationMode="2.0"/>
    
          <pages validateRequest="false"
                  pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
                  pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
                  userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <namespaces>
            <add namespace="System.Web.Helpers"/>
            <add namespace="System.Web.Routing"/>
            <add namespace="System.Web.WebPages"/>
            <add namespace="System.Web.Mvc"/>
            <add namespace="System.Web.Mvc.Ajax"/>
            <add namespace="System.Web.Mvc.Html"/>
    
            <add namespace="Ext.Net"/>
            <add namespace="Ext.Net.MVC"/>
          </namespaces>
          <controls>
            <add assembly="System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc"/>
            <add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext"/>
          </controls>
        </pages>
        <httpHandlers>
          <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false"/>
        </httpHandlers>
        <machineKey decryption="AES" validation="SHA1" decryptionKey="435D9CC99471D1E7C70FFEBA5EC71F28048BF9016605B82CC69B091FD317B294" validationKey="25C5D98CE093E77C2F886A6D8C6DA8FBC77CD764A1BF49E5D30CD123C5E19553"/>
      </system.web>
      <system.webServer>
        <defaultDocument>
          <files>
            <add value="index.cshtml"/>
          </files>
        </defaultDocument>
        <modules>
          <add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net"/>
        </modules>
        <handlers>
          <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler"/>
        </handlers>
        <validation validateIntegratedModeConfiguration="false"/>
      </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
            <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
          </dependentAssembly>
    
          <dependentAssembly>
            <assemblyIdentity name="Ext.Net.Utilities" publicKeyToken="2c34ac34702a3c23"/>
            <bindingRedirect oldVersion="0.0.0.0-2.5.0" newVersion="2.5.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Transformer.NET" publicKeyToken="e274d618e7c603a7"/>
            <bindingRedirect oldVersion="0.0.0.0-2.1.1" newVersion="2.1.1"/>
          </dependentAssembly>
    
          <!--MVC 5-->
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    I then build a simple index.cshtml page with the following:
    @using System.Web.Mvc
    @using Ext.Net;
    @using Ext.Net.MVC;
    @{
        Layout = null;    
        var X = Ext.Net.Html.X();
    
        @Html.X().ResourceManager().Theme(Theme.CrispTouch)
        @RenderPage("~/Viewpage1.cshtml");
    }
    Global.asax has all the relevant code listings (copied from Ext.net MVC sample) which includes registering routes etc. But compiler still throws an exception 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'X'
  2. #2

    My Bad

    My Bad. Had assumed there was support for webform controls in Web Pages 2, and was mixing mvc razor with razor web pages.

    Found a corresponding article on what I was attempting to achieve, but its not supported:
    http://www.hanselman.com/blog/Mixing...SPNETMVC3.aspx

Similar Threads

  1. Creating Razor helper methods for custom controls
    By Daniil in forum Examples and Extras
    Replies: 7
    Last Post: Apr 28, 2016, 7:29 PM
  2. [CLOSED] Html.X().GridFilters() stuck RAZOR
    By zwf in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 30, 2012, 2:46 PM
  3. [CLOSED] WebPages AND Namespace
    By CPA1158139 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 26, 2012, 4:34 PM
  4. [CLOSED] Compile error - WebPages is not a member of System.Web
    By betamax in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 04, 2012, 10:21 PM
  5. Replies: 3
    Last Post: Feb 21, 2012, 7:46 AM

Posting Permissions