View (MVC)

Why Trust Techopedia

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
Technology Specialist
Margaret Rouse
Technology Specialist

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.