renderaction

Is it a good idea to put content access logic in a BaseController?

I'm developing an ASP.NET MVC application where the content for any page can be pulled from the database, if it exists, and displayed on the page. This is to make it possible for non-technical persons to edit the content without having to go into the source code (e.g. views) and change things. The way I'm doing this is, each controller...

Maintaining ViewData between RenderAction calls

I'm rendering a common Log-In form using Html.RenderAction, on every page of my site. If the user enters their details into the text-box and clicks 'Submit', it does a POST to a controller that handles the log in. If they make a mistake, such as entering an invalid email address, it will populate the ModelState with an error message an...

create controller base class(partial)

ok here goes, since my html.renderaction crashes my dev and prod servers i have to use partials(crap) i tried creating public partial controller{} class so i can set needed data for all my views but i am having no luck (everything breaks) i am coming from LAMP cakePHP background and really need simplicity. i need to know how to create...

ASP.NET MVC with tree - pattern

Hello, I am preparing a skeleton of ASP.NET MVC application with basic CRUD functions on Products and Parts included in these products. Application contains couple of strongly-typed views based on the MasterPage and now I want to add a widget to display the menu tree. This menu tree is going to reflect the Products/Parts structure so it ...

RenderAction - Using it without influence to parent

If I call RenderAction on action method which view has Html.BeginForm() with no params my form action folows the parent url. If I add any param (route values, action, etc) , form action attribute is replaced with MyChildContorller's controller name and action. How to use RenderAction without affecting parent url? ...

Using RenderAction() and posting back to sub-controller action

I have parent view that also renders sub-controller action using RenderAction() (that returns a PartialView). An example is a front page with Login partial view (inputs: username, password, remember and action: login) Execution process GET for Home/Index - also displays my login control that has its login pointing to sub controller Us...

ASP.Net 2.0 and the new RenderAction method.

Hello, I just recently migrated my ASP.Net MVC project from MVC 2.0 Preview 2 to MVC 2.0 Beta, and my calls to Html.RenderAction broke because a new RenderAction method was introduced in MVC 2.0 Beta. In the following line: <% Html.RenderAction("DisplayIMHandles", "UserProfile", new { userProfileId = Model.Id }); %> I get the follow...

More than one Http.RenderAction() in a single View

As we all know RenderAction() is either part of: Asp.net MVC 1 Futures or Asp.net MVC 2 Beta 2 and allows us to render action result inside another view or partial view. Description You have a view with multiple partial views displayed using RenderAction() helper. At least two partial views render a <form> probably by using Html.B...

ASP.NET MVC 2 beta Asynchronous RenderAction

Background: http://www.hanselman.com/blog/HanselminutesPodcast188ASPNETMVC2BetaWithPhilHaack.aspx Start from 27:15,RenderAction has been discussed at 28:43 that a RenderAction will not be part of Asynchronocity as an asyncronous action method called. (Let's say your home portal index action calling 1.GetNews 2.GetWeather 3.GetStock as...

SparkViewEngine, RenderAction and Areas with ASP MVC 2 Beta?!

I just ran into trouble with the AreaDescriptionFilter of Spark using MVC 2 Beta. The following line is from my Application.spark file. It results in the view engine looking in all possible locations of the view - except in the folders of the area "Shell". # Html.RenderAction("ShowMainMenu", "Navigation", new { area = "Shell" }); Run...

Like Html.RenderAction() but without reinstantiating the controller object

I like to use the RenderAction extension method on the HtmlHelper object to render sidebars and the like in pages, as it allows me to keep the data access code for each such part in separate methods on the controller. Using an abstract controller base, I can define a default "sidebar strategy", which can then be refined by overriding the...

asp.net MVC RenderAction coordinator

We're looking at the ASP.NET MVC 2 beta RenderAction() method. We like it very much but it seems that we can't use async controllers with it. Does anyone have an example of a "controller" that can figure out all the actions that will be called, cache the data, then let the called actions know that their data already exists vs. having ...

How do I render an alternate child view in MVC?

I'm new to working with MVC so please don't assume I know anything. I am picking up a project that has much already written in MVC and I am trying to add some things to it. On one View there is a line <% Html.RenderAction("List", "Image", new { id = Model.JobId, all = true }); %> I see a List.ascx under the Image directory. I see ...

Render action return View(); form problem

I'm new to MVC, so please bear with me. :-) I've got a strongly typed "Story" View. This View (story) can have Comments. I've created two Views (not partials) for my Comments controller "ListStoryComments" and "CreateStoryComment", which do what their names imply. These Views are included in the Story View using RenderAction, e.g.: <...

Should RenderAction be used with forms?

My setup: Have a view for a route like: /Pages/Details/2 The page details view has <% Html.RenderAction("CreatePageComment", "Comments"); %> to render a comment form Comment form posts to Comments/CreatePageComment /Comments/CreatePageComment returns RedirectToAction when a comment is created successfully This all works nicely My que...

Asp.Net Mvc - RenderAction - Create in a list view

EDIT I put my solution on a share site. Like that you'll be able to see what I'm talking about. You can download it here : http://www.easy-share.com/1909069597/TestRenderAction.zip To test it, start the project (let the create form empty) and click the Create button. You'll see what happen. It's only a example project. I don't care to...

ASP.NET MVC Dynamic RenderActions in jquery tabs

Ok, so, that title is a mouthfull... But, I reckon you understand what I'm trying to do. I have a page which contains the jquery tabs control, and I render the different tabs by looping through my model. Now, the divs (that are "linked" to those tabs) are also created with the same loop. Hence I have equal tabs + divs connected to those...

ActionFilterAttribute: Where is the 'Cancel' property?

Whatever happened to the Cancel property on the ActionExecutingContext? How would one abort a RenderAction when using an ActionFilterAttribute or is there another way to skin this cat? public override void OnActionExecuting(ActionExecutingContext filterContext) { if(!filterContext.HttpContext.User.Identity.IsAuthenticated) { ...

Parameter ok in RouteData but passed as null in controller

I'm a few weeks into MVC now, and each day, something new pops up which strikes me as quite odd. So, I try to find answers to the issues I'm facing. None the less, for the current issue, I can't seem to find a descent answer here on stackoverflow, or anywhere on google for that matter... I'm having an issue passing parameters to my cont...

Html.ActionLink() gives me an empty link when I use it inside Html.RenderAction()

I have a Microsoft MVC project with an action "Foo" whose view ("Foo.aspx") contains the lines: <%= Html.ActionLink("mylinktext1", "bar") %> <%= Html.ActionLink<MyController>(x => x.Bar(), "mylinktext2") %> When I hit this from a web browser or load it from an AJAX call, it properly returns: <a href="/bar">mylinktext1</a> <a href="/B...