In webforms, we do things like:
<%# CallSomefunctions(Eval("CustId")) %>
This function is present in asp.cs which can format our data and return appropriate string. How can we do the same in asp.net mvc since we do not have any concept of code behind?
The short answer is: You don’t. Doing this violates the principles of MVC. The responsibility of your
.aspxpage it to convert a model (some .NET object) into something you can present to the user and nothing else. Having it execute code violates this one-responsibility principle.