Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The Exception Message is very descriptive and says it all. your view accepts a different model and you are passing different model to this view in controller. Look at two places </p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;AcceptedModel&gt;" %&gt; </code></pre> <p>and in your controller you would have something like</p> <pre><code>public ActionResult action() { SentModel model = new SentModel(); return View(SentModel); //i believe typeof(SentModel) != typeof(AcceptedModel) that is what is causing problem } </code></pre> <p><strong>Edit</strong> you can use viewModel that can contain all values required by the view</p> <pre><code>public class MYViewModel { System.Data.DataTable MyTable{get;set;} Registration Myregistration{get;set;} } </code></pre> <p>now in controller you can populate your viewModel like</p> <pre><code>public ActionResult MyActionResult(int id) { MyViewModel mdl = new MyViewModel(); mdl.Myregistration = new Registration(); mdl.MyTable = //code to populate table return View(mdl); } </code></pre> <p>and in the view you should update it to accept MyViewModel type</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;MyViewModel&gt;" %&gt; </code></pre> <p>and then you can access them in view using</p> <pre><code>&lt;%foreach( var row in Model.MyTable){}%&gt; and &lt;%:Model.MyRegistration.FirstName%&gt; </code></pre>
    singulars
    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.
    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