0

first let me say, I have started my first ASP.NET MVC (4) application. Before that, I was a forms developer. I love the MVC concept, even though I have not yet fully understood.

In ASP forms times, we could create a control to encapsulate and use it again. I could not figure out yet which element is similar in MVC. I created a Viewed User Control but that hasnt a code-behind file..

Can you give me an example?

Best regards Patrik

tereško
  • 58,060
  • 25
  • 98
  • 150
Patrik
  • 1,119
  • 5
  • 18
  • 37

2 Answers2

0

I'm not positive, but perhaps you might be interested in Partial Views. Here is an article on resuable UI Components

Rob Allen
  • 2,871
  • 2
  • 30
  • 48
0

Instead of user controls, try razor helpers refer this link for details. http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx

Even though MVC3 is discussed in the blog post, no need to worry. It is not changed in MVC4

Yogiraj
  • 1,952
  • 17
  • 29