viewresult

ViewResult and lookup directories

new ViewResult() { ViewName = "Error_403" }; in this case .net looks through current controller view directory (~/Views/Home/) and in shared (~/Views/Shared/) Is there any way to point to specific directory right here ViewName = @"Errors\Error_403"? Or may be any other simple solutions? ...

DefaultBinder in MVC problem

Hi! I just started working in MVC and I have a problem: public class ServicePhone { public int AgreementId { get; set; } public List<PhoneNumber> Phones { get; set; } public ServicePhone() { Phones = new List<PhoneNumber>(); } public PhoneNumber NewPhone { get; set; } } public class PhoneNumber { p...

ViewResult returns no data

Hi! I am using the pattern from NerdDinner. I call Index() in my test Method and I the ViewREsult I get back has no data. So the variable data ends up being null. However, I know that there is data there. Because I can go to the watch window and expand the variable result and expand viewData->Model->ResultsView then I see the "expandi...

MvcContrib : returning an existing ViewResult does not redirect to the correct page.

I've the following scenario: Go to the /User.mvc?userId=200&otherId=1 page. Change some data. Press Update button. Show the /User.mvc?userId=200&otherId=1 page. I used MvcContrib + T4MVC with the following code: [AllRolesAuthorize()] public virtual ViewResult Index(long? userId, long? subPracticeId) { long selectedUserId = userI...

ASP.NET MVC - HybridViewResult (ViewResult /PartialViewResult)

Is it possible to build a hybrid ViewResult that returns in depedency of an AjaxRequest or HttpRequest a PartialViewResult or ViewResult? IsAjaxRequest --> return PartialViewResult !IsAjaxRequest --> return ViewResult As far as I know my HybridViewResult should derive from ViewResultBase. But how to implement the FindView method? ...

Bestpractice DI with ASP.NET MVC and StructureMap - How to inject dependencies in an ActionResult

I edited my whole question, so do not wonder :) Well, I want to have an ActionResult that takes domain model data and some additional parameters, i.e page index and page size for paging a list. It decide itself if it returns a PartialViewResult or a ViewResult depending on the kind of web request (ajax request or not). The reffered dat...