Click here to Skip to main content
15,908,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a Empty ASP.net MVC 3 app and i created it by using "Database First" approach.

In that database, i have two tables with some fields and their names are User and Organization.

Now in Model,

i created three classes namely Login, User, Organization, and for Login class i did not have any table in database
and i declared the variables User and Organization classes with same names as that are in database tables...

Now i want to use the user and organization variables into Login class and for that i declared them as Vitual.

later i added the controller and dropdownlist view bag and view and runned it and it is prompting the error message as follows..

'System.Collections.Generic.IEnumerable<emvc_css.models.modelclasses.user_details_class>' does not contain a definition for 'UName' and no extension method 'UName' accepting a first argument of type 'System.Collections.Generic.IEnumerable<emvc_css.models.modelclasses.user_details_class>' could be found (are you missing a using directive or an assembly reference?)


any idea regading this to solve the problem
Posted

1 solution

This error usually prompt in this situation-

If you were passing the IEnumerable value from a method in controller then not catching it in its respective view like-

@model IEnumerable<your type="">
it should be on the top of your view.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900