How can we pass class instances to view?


How can we pass class instances to view?



I just wonder that can we pass any type of class instances to view which is not exist in our Model repository.for example i just want to show property values of any class instance which exist in .net framework such as List, ListArray and others.

Edit:

Question is edited cause misunderstanding possibility.


asp.net mvc 2.0 Jquery form submit

1:

Pulling a View from a database rather than a file
It seems you may be looking to create a strongly typed view This tutorial should show you the steps:. When is it ok to meddle in the page lifecycle an ASP.NET MVC page? http://stephenwalther.com/blog/archive/2009/04/13/asp.net-mvc-tip-50-ndash-create-view-models.aspx. Significant advantages of ASP.NET MVC In short the declaration at the top of your view has to specify the type of model you expect from the controller like this. ASP.NET MVC application fires Session_Start multiple times for a single session
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"  Inherits="System.Web.Mvc.ViewPage<MvcApplication1.Controllers.ProductViewModel>" %> 
Where Inherits="...ProductViewModel" is whatever type you want the .Model variable to be and thusly need be supplied by the controller.. Asp.net MVC Binding
Deploy ASP.NET website alongside ASP.NET MVC websitestyle problem with data returned from action method

2:

You probably need to add any namespaces to the Web.Config..
<pages>  <namespaces>   <add namespace="System.Web.MVC"/>   <add namespace="System.Web.LINQ"/>   <!-- ... -->   <!-- Add more namespaces you need here -->  </namespaces> </pages> 
You indeed should be able to access any class in your app / includes within your views, although you have to qualify them with a namespace. Only a few namespaces are included by default.. Here is an article this explains how to add namespaces to the Web.Config so you must access classes in this namespace directly in your views:. http://davidhayden.com/blog/dave/archive/2009/10/13/ViewNamespacesInWebConfig.aspx.

3:

You mean: . <%@ Import Namespace="System.Collections.Generic" %>. msdn.


99 out of 100 based on 74 user ratings 709 reviews

@