asp.net mvc create a c# class in an ascx file for design purposes

Posted by Julian on Stack Overflow See other posts from Stack Overflow or by Julian
Published on 2011-01-01T14:44:34Z Indexed on 2011/01/01 14:54 UTC
Read the original article Hit count: 502

Filed under:
|

Hi,

I am developing a web application using asp.net mvc.

I have come across the need to Temporarily create a class in the ascx/aspx file.
This class will replace the Model during the development of the page.
It will also hold some test data for the user to have the chance to see some results.

Once we are happy with the layout on the screen, I will inherit the correct Model class through the Control tag.

Can you please advise if this is possible and how to do it?

This does not work:

<%
    class Modelo
    {
        public Guid Guid { get; set; }
        public string Name { get; set; }
    }
%>

Thanks in advance, Be happy - Julian

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about asp.net-mvc-2