Note that there are some explanatory texts on larger screens.

plurals
  1. PO"@model" not working on razor page in hybrid WebForm/MVC site
    primarykey
    data
    text
    <p>I'm integrating MVC into our current .Net WebForms site. I used these links for guidance while setting it up. <a href="http://www.hanselman.com/blog/IntegratingASPNETMVC3IntoExistingUpgradedASPNET4WebFormsApplications.aspx" rel="nofollow">Hanselman - Integrating MVC</a> and <a href="http://blog.falafel.com/Blogs/BasemEmara/basem-emara/2012/09/27/integrating-asp.net-mvc-4-into-existing-web-forms-applications" rel="nofollow">blog.falafel</a>.</p> <p>The site works and I can navigate to .aspx pages and controller/actions no problem. But when I try to add the @model to a razor page, @model doesn't appear to be registering and Visual Studios sees as a HTML5 item.</p> <p>exception:</p> <p>{"c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\a3be471e\a209a63\App_Web_index.cshtml.a8d08dba.d7uqhlro.0.cs(30): error CS1514: { expected"} System.Exception {System.Web.HttpCompileException}</p> <p>I added all of the appropriate references and went over both sites multiple times.</p> <p>List of references I added - </p> <pre><code>Microsoft.Csharp System.ComponentModel.Data System.Web.Mvc System.Web.Razor System.Web.WebPages System.Net.Http System.Web.Optimization System.Web.Http System.Web.Http.WebHost Newtonsoft.Json </code></pre> <p>Web.config additions</p> <pre><code>&lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;system.web&gt; &lt;pages&gt; &lt;namespaces&gt; &lt;add namespace="System.Web.Helpers" /&gt; &lt;add namespace="System.Web.Mvc" /&gt; &lt;add namespace="System.Web.Mvc.Ajax" /&gt; &lt;add namespace="System.Web.Mvc.Html" /&gt; &lt;add namespace="System.Web.Routing" /&gt; &lt;add namespace="System.Web.WebPages"/&gt; &lt;/namespaces&gt; &lt;/pages&gt; &lt;/system.web&gt; &lt;configuration&gt; &lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt; &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload