Posts Tagged ‘MVC’

Magic @Html.DropDownList

This is observed in MVC5

When one of properties of model is associated with another list, it is normal practice that  list is saved in the ViewData as a SelectList , then in the View, the same list is retrieved back and passed to the html helper @Html.DropDownList(modelpropertyname,the SelectList)

What puzzled me is the second parameter, the SelectList could be ignored or even is attempted to be retrieved in a wrong way, ┬áthe List could still be loaded correctly. Read the rest of this entry »



Many years ago I have written an article about demystifying WCF in Asp.Net, today I am going to show you how to create and host WCF services in a MVC environment, in the article mentioned earlier, it is said that WCF service is a ServiceHost, what is it then for WCF service consumer? So you will also be able to see in here that how to create a service consumer in a demystified way.

Read the rest of this entry »

Tags: ,

Share MVC PartialView between server and client

In MVC you can divide a big view into smaller partial views, while with ajax these partial views can also be used by ajax to do partial update of an already rendered page. Read the rest of this entry »


MVC DropDownList IEnumerable binding error

When you try to bind a model field with a dropdownlist in view, you need to create a SelectList in controller then pass that SelectList to view from ViewBag or ViewData, normally there will be a conversion happening from your collection to SelectList, Read the rest of this entry »