Wednesday, January 1, 2014

ASP.NET MVC Views

Like in ASP.NET or Active Server Pages, ASP.NET MVC does not have anything that directly represents a page. In MVC, you have views. 

You can access views through controller actions.

Adding content to a View

A view is a standard XHTML document that can contain scripts. You can use scripts to add dynamic content using script delimeters ( <% %> ). You can also use HtmlHelpers to add content. 

You can use ViewData from controller action to pass data to the view. It is a collection of name-value pairs. 

HtmlHelper
Support for rendering HTML controls in a view. Class provides methods that help you create HTML controls programmatically. All HtmlHelper methods generate HTML and return the result as a string.

TagBuilder (tutorial)
ASP.NET MVC framework also includes utility class named TagBuilder when building HtmlHelpers. 


0 comments:

Post a Comment

Powered by Blogger.


Software Architect at Surge Global/ Certified Scrum Master

Experienced in Product Design, Software Engineering, Team management and Practicing Agile methodologies.

Search This Blog

Facebook