Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From your question description, it shows that, I think you are using <code>Asp.Net MVC 2</code> and you just tried to use the <code>functionality of Asp.Net MVC 3.</code></p> <p><strong><code>ViewBag</code></strong> comes with <code>Asp.Net MVC 3 (It's feature of Asp.Mvc 3)</code></p> <p>There are few suggestions that you can try to avoid compilation error.</p> <ol> <li><p>Install <code>Asp.Net MVC 3</code> (Install .<code>Net Framework 4 prior</code>)</p></li> <li><p><code>Change your project property.</code> (Right Click Web Project -> click 'Properties' -> Application tab -> Target Framework -> Change to .NET Framework 4</p></li> </ol> <p><strong>Check and Change your web.config as below:</strong></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;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; </code></pre> <p>Hope this helps!</p>
    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