View (MVC)

What Does View (MVC) Mean?

A View, in the context of a Model View Controller (MVC) architecture, is a software class that contains a template and data form and produces a response for the browser. It receives data from the Controller of the MVC and packages it and presents it to the browser for display.

Advertisements

The View is not very autonomous -it is like a black box where some data is thrown at it and it gives a display to the user in a browser friendly manner. It collects the input data from data sources, finds the template upon invocation, and combines them into HTML output at runtime.

Techopedia Explains View (MVC)

The way the Controller passes data down to the View is through a dictionary called a ViewData dictionary. This dictionary contains the packaged results which end up being converted to the resulting HTML output.

The output from a View is usually HTML, however it can also be defined to give other view results such as JSON strings and JavaScript code.

The View is a common aspx file which would contains the relevant controls of the specific ASP.NET application. A View can be shared by multiple controllers and can be partial or strongly typed. The partial view is analogous to controls in webforms and is rendered through the ViewUserControl class.

If a View is not a partial view it would be a master page. This masterpage is similar to the masterpage in webforms; however, it is located under the ViewShared folder. A strongly typed View is isolated from the Controller and the data can be passed in two distinct ways either through the ViewData dictionary or via an object model.

Advertisements

Related Terms

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…