strongly-typed-view

Custom ViewModel with MVC 2 Strongly Typed HTML Helpers return null object on Create ?

I am having a trouble while trying to create an entity with a custom view modeled create form. Below is my custom view model for Category Creation form. public class CategoryFormViewModel { public CategoryFormViewModel(Category category, string actionTitle) { Category = category; ActionTitle = actionTitle; } ...

Pass data to Master Page with ASP.NET MVC

I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a "menu" User Control and a "footer" User Control. Anyways. I need to pass some data (2 strings) to my "menu" User Control on my Master Page (to select the current tab in my menu navigation, etc.) My views are strongly-typed to my data model. How can I push data...

ASP.Net MVC, strongly typed view with DateTime not accepted?

Hi all, I wish to create a view like <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %> but I get an error saying that DateTime must be a reference type in order to use for parameter TModel. Fair enough, but I google plenty of examples that implement just what I try to achieve. Any clues as to ...

Should strongly typed partial views on one page in asp.net mvc-2 have one combined view model?

Hi guys, I have a question about asp.net mvc-2 strongly typed partial views, and view models. I was just wondering if I can (or should) have two strongly typed partial views on one page, without implementing a whole new view model for that page. For example, I have a page that displays profiles, but also has an inline form to add a q...

Can't select View Content dropdown when adding view in MVC using Interfaces

I have my Model defined externally in two projects - a Core project and an Interface project. I am opening the Add View dialogue from my controller, and selecting Create a strongly typed view. In the drop down list, I can select the concrete types like MyProject.Model.Core.OrderDetails, but the interface types like MyProject.Model.Int...

ASP.NET MVC strongly typed view compilation error

This is a strange one. I changed something (not sure what) and now my app's view doesn't compile at runtime. The view itself is strongly typed: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MyNamespace.OperatorModel>" %> When I visit the page, it fails to compi...

Rendering one partial view in two different strongly typed views

I have a strongly typed Person view, that I want to render a partial in: Person View (strongly typed as person) <label for="name">Name</label> <% Html.RenderPartial("AddressForm"); %> </label> AddressForm View (untyped, because I also want to use this in the Distributor strongly typed view) When I try to call this partial from t...