c# - Microsoft.CSharp.RuntimeBinder.RuntimeBinderException Error -


I am stuck on this error for about one day and I do not understand why I am getting it. / P>

Error:

One type of exception was 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' in System.Core.dll but was not handled in user code

Additional information: The best overloaded method for 'System. Web.Helpers.WebGrid.Bind.bind

Controller:

  var data = Broad in Milan brand DB From DB Division in Division DB. In Supplier where the brand from the supplier. Brendad == division. Division id where the product is. SPLDID == Supplier. Select SuperDider new modelglid {BrandID = brand.brandID, BrandName = brand.brandName, DivisionName = division.DivisionName, CompanyName = supplier.CompanyName, ContactName = supplier.ContactName, Country = Supplier. Country}). ToList (); See Return (data);   

View:

  WebGrid grid = new webgrid (model); Grid .bind (model, puncticount: vubag quount, autoront and page: incorrect); Grid: "Grid" column ("brand name", "brand id", canert: true), grid column ("brand name", "brand name", canert: true), grid. Columns ("Company Name", "Company Name", "Company Name", canSort: true), Grid Columns ("Contact Name", "Contact Name", "Column", "Division Name", "Division Name", canSort: true), Grid. CanSort: true) Public class ModelGrid {public int BrandID}, the grid. ("Country", "country", canSort: true))   

and ideal: < pre> {received; Set; } Public String BrandName {get; Set; } Public String DivisionName {get; Set; } Public String CompanyName {get; Set; } Receive public string contact name { Set; } Public string country {get; Set; }}

I think I get this error while using anonymous types, but I thought I did not pay attention to it. I am still learning at this point so that any advice can be greatly appreciated.

Try this and see that it works

  grid. Bind (see model, row number: (int) bag quote, autostart and page: wrong);   

I think viewBag is a dynamic type due to its failure and it does not know that calculation is an int and bind method, an int is expected for the line.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -