There is a null reference exception occurred in MVC 4 application as below

click here to view exception

but values are came to the variable. there for no point to happen null reference exception. why is that. good luck :)

You'll have to double check each x item in your list. One of them doesn't have a value for the name property. The null pointer exception really only means one thing: the value it refers to is null.
Step through the loop in the debugger, wait for it to error and go back a couple of lines, check which item in the loop you're up to and confirm it's values.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.