I’m quiet newbie to ASP.NET MVC world. In Web Form we can write a user control and encapsulate all the details within. We can then reuse the control on N number of pages which is a good code-reuse.
I would like to do the same in MVC 3/4 and haven’t had any lucks. Could someone please help me with how above can be achieved?
Thank you.
There is no exact equivilent. There are, however, ways to reuse code. You can create HtmlHelper extensions (like the Html.Whatever() methods), Or you can use Partial Views, or you can use templates. All of these do different things, but they offer various ways to reuse code.