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 »

Tags:

More than one export was found that matches the constraint

When using MEF, you might one day find a class that is marked as export is not exported. Having a look at the trace window in VS, there is a line as:

More than one export was found that matches the constraint:
ContractName XXXX
RequiredTypeIdentity XXXX

Resulting in: Cannot set import ‘YYYY..ctor (Parameter=”operand1″, ContractName=”XXXX”)’ on part ‘YYYY’.
Read the rest of this entry »

Tags:

Lifetime of parts created by MEF container

You might be confused that when lifetime of parts that are created by MEF container.GetExportedValues appeared to be NOT controlled by their container. the confusion comes from that fact that most of MEF documentations have not mentioned that parts could be referenced by other objects in your system apart from container, in that case, container will not be responsible for life time of parts SOLELY. Read the rest of this entry »

Tags:

A Complete Example of WCF,Ajax, SSL and None SSL

Here is a complete example of using wcf and ajax via JQuery, the configuration for wcf under ssl is also included. Read the rest of this entry »

Tags: , ,

Regex multiple occurrence search

Here is a task we have very often, multiple occurrence or recurring match, this is made easy by understanding zero width assertion and greedy –lazy matching. Read the rest of this entry »

Page 5 of 21« First...34567...1020...Last »