Responsive Ad Area

Share This Post

test

Why always shown error using ExpandoObject in ASP.NET MVC?

My code is:

        dynamic mymodel = new ExpandoObject();
        mymodel.Preferences = db.Preferences.ToList();
        mymodel.Stores = db.Stores.ToList();
        mymodel.Categories = db.Categories.ToList();
        return View(mymodel);

This code works fine in my localhost, but after hosting pages include this code shows error “Attempt by method ‘DynamicClass.CallSite.Target(System.Runtime.CompilerServices.Closure, System.Runtime.CompilerServices.CallSite, Shops.Controllers.PreferenceController, System.Object)’ to access method ‘System.Web.Mvc.Controller.View(System.Object)’ failed”


Why always shown error using ExpandoObject in ASP.NET MVC?
Why always shown error using ExpandoObject in ASP.NET MVC?
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar