Questions tagged [renderaction]

RenderAction is an ASP.NET MVC helper method, available starting in the 2nd version, that calls from a view and outputs the results of the action in place within the view.

130 questions
2
votes
0 answers

RenderAction and Partials with output caching

I am currently setting up my mvc4 web application and have a question regarding using Partial views and Render Action. If I apply output caching to a controller action method, will that save a request to the action method when using…
amateur
  • 43,371
  • 65
  • 192
  • 320
2
votes
2 answers

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…
Jonathan
  • 32,202
  • 38
  • 137
  • 208
2
votes
2 answers

MVC3 - 4 Multiple Forms using Partial Views

So, I am creating an Admin page that I would like to put multiple forms on. So, I tried doing it using a Partial View and RenderAction. My Admin Index View: @model Rad.ViewModels.AdminViewModel @{ ViewBag.Title =…
ScubaSteve
  • 7,724
  • 8
  • 52
  • 65
1
vote
1 answer

Html.RenderAction in MVC with EntityFramework

My problem is when I try to render a view with two Html.RenderAction. It says: "The operation cannot be completed because the DbContext has been disposed". I have Ninject configured in this…
Tekno
  • 193
  • 1
  • 1
  • 11
1
vote
4 answers

Problems with RenderAction in MVC 3

I wanted use MVC and renderpartial to generate a menu but but could not get it to work, and from what I read it seemed maybe RenderAction would be more suitable. Still I have not gotten it to work. What I intended to do was create a controller that…
Dennis
  • 373
  • 1
  • 6
  • 21
1
vote
3 answers

Rails how do you call action in another controller and get the controller code for that action to run?

Possible Duplicate: Rails: call another contoller action from a controller Hi I'm new to rails and in my home page view I want to call actions in other controllers. I am using render 'the/relevant/url'. This is calling the view but not hitting…
c00ke
  • 2,245
  • 5
  • 26
  • 34
1
vote
2 answers

QueryString and RenderAction

I'm setting a class on my html tag when a specific query string argument is sent, right now I'm doing it like this (Razor view master page): @if (HttpContext.Current.Request.QueryString.AllKeys.Contains("Foo") &&…
Victor
  • 3,999
  • 3
  • 24
  • 27
1
vote
2 answers

RenderAction a list of a model in the layout

So I want to put a list of newsitems in _Layout.cshtml I have a News model and a Show Action in its controller, and I want to put it in there with a RenderAction. @Html.RenderAction("Show","News"); Does not seem to work. But…
DasRakel
  • 73
  • 7
1
vote
0 answers

Is it possible to override Html.RenderAction() in ASP.NET?

I want to send/pass some data as parameter from one .cshtml to another .cshtml page. For example: Html.RenderAction("Action", "Controler", new{name="ABC", age=23}); https://domain/Controller/Action [.cshtml page]
Amar Anondo
  • 662
  • 10
  • 16
1
vote
1 answer

Multiple form submits with RenderAction

I am using RenderAction to include the form below in my views: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl>" %> <% using (Html.BeginForm("form1", "UserControls", FormMethod.Post, new { @id = "form1"…
Anders
  • 647
  • 2
  • 8
  • 16
1
vote
1 answer

RenderAction to generate dropdown?

I'm having a mvc form which among other things contains an int that should be mapped to text strings displayed in a dropdown. MyViewModel { ...other fields... int Level { get; set; } ...other fields... } Is it possible to use…
Carl R
  • 8,104
  • 5
  • 48
  • 80
1
vote
0 answers

Is there a better way to implement forms than using RenderAction?

I am working on a .Net MVC2 project where I am trying to modularize functionality as much as possible. One aspect of this would be to place a form in a partial views which is then called using RenderAction. This is so that the form's GET, POST,…
Digbyswift
  • 10,310
  • 4
  • 38
  • 66
1
vote
2 answers

Weird behaviour with RenderAction

On a View I am calling Render action with from within a loop, the action will create an array of objects and return to a PartialView with a Grid to display the results. View: foreach (var item in Model) <%Html.RenderAction("GridData", "Customer",…
keitn
  • 1,288
  • 2
  • 19
  • 43
1
vote
1 answer

Is there a way to use something like within partial views that are rendered with RenderAction?

In my ASP.NET MVC 2 web application, I utilize RenderAction to display HTML in what I call the "flash message" area of the web site. By flash area, I mean a highlighted area near the top that contains a message about the previous request, such as…
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
1
vote
2 answers

ASP.NET MVC to PHP Laravel Migration: Html.RenderAction Alternative

I'm currently developing a CMS using PHP Laravel (5.4) based on an existing ASP.NET MVC version I've made in the past. Since most of the ASP.NET version is written in JS, I'm trying to reuse the most I can in the newer Laravel version I'm…
Ricky
  • 2,912
  • 8
  • 47
  • 74
1 2 3
8 9