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.
Questions tagged [renderaction]
130 questions
6
votes
2 answers
RenderAction not finding action method in current controller in current area
I'm creating an ASP.NET MVC 2 (RTM) project that uses areas. The Index action of the Home controller of one area needs to use RenderAction to generate a sub-section of the page. The action called is also defined in the same Home controller. So the…

Andrew Davey
- 5,441
- 3
- 43
- 57
6
votes
1 answer
ASP.NET MVC - Ajaxified RenderAction
I am happy with what the RenderAction() function does. However, I'd like to ajaxify the loading and storing of data in the partially rendered action, so that everything happens in one page.
Imagine the following case: I have an article details…

xantrus
- 1,975
- 1
- 22
- 44
6
votes
1 answer
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…

Jørn Schou-Rode
- 37,718
- 15
- 88
- 122
5
votes
1 answer
Does Html.RenderAction create a separate request?
I'm not seeing any extra requests in Fiddler when I have a view that makes RenderAction calls. Is it because it isn't a separate web request, per say, it's all done internally when the controller is rendering its view?

user895400
- 368
- 1
- 7
- 18
5
votes
1 answer
Rendering views without master page in MVC3
I have a few views on my website that i need to include on a start page. However, just using Html.Renderaction renders the master page and the whole shebang.
How would i go about just rendering the content?

Andreas Eriksson
- 8,979
- 8
- 47
- 65
5
votes
1 answer
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…

Roger Rogers
- 535
- 1
- 4
- 15
5
votes
1 answer
refreshing html.renderaction with ajax request
I have div that renders image gallery on my page
@{
Html.RenderAction("UserGallery");
}
I have this function which runs on the completion of a successful upload of a new image
function…

ChampChris
- 1,565
- 5
- 26
- 44
3
votes
1 answer
How do I achieve ModelBinding with Html.RenderAction?
I'm working through a MVC book which uses the older version of Html.RenderAction. So it looks like this in the book Html.RenderAction("Summary", "Cart"); I have had to convert to Html.RenderAction(m => m.Summary(new Cart()));.
Where…

g.foley
- 2,152
- 3
- 19
- 27
3
votes
2 answers
ASP.Net MVC reusable form as RenderAction or RenderPartial
I'm looking for a best practice for embedding a form on multiple pages as a partial view.
I have a contact form I'm looking to embed on multiple pages on a site. Usually, the form would be on a contact page and the contact model could be the model…

RobertMGlynn
- 475
- 1
- 5
- 17
3
votes
4 answers
When Is It Appropriate to Use Html.RenderAction()?
I'm a little bit unsure about when it's appropriate to use Html.RenderAction() to render my Views and when not to. My understanding is that because it's not an 'official' component of ASP.NET MVC it's bad practice to use it, and its original…

DaveDev
- 41,155
- 72
- 223
- 385
3
votes
2 answers
Stack Empty issue on concurrent use of MVC application
We recently developed a new ASP.NET MVC 4 web application (C#/Visual Studio). After local testing and debugging we deployed it to production, and then started getting more and more health monitoring mails. These had different Exception…

Bart
- 5,065
- 1
- 35
- 43
2
votes
1 answer
Render action performance
I have view that display Question, Answers, Comments to answers and to Question.
To display all data i want to use something like this:
[HttpGet, ChildActionOnly]
public PartialViewResult RenderQuestion(int questionId, int page, int…

David Levin
- 6,573
- 5
- 48
- 80
2
votes
0 answers
Partial view/RenderAction returns 404 on model validation errors
I have an ASP.NET MVC3 site where I need to show some account-related stats in the sidebar
I have a RenderAction in the layout i.e.
@{ Html.RenderAction("GetStats", "MyController"); }
and the action method in MyController returns some text
…

seekay
- 2,493
- 3
- 27
- 33
2
votes
1 answer
MVC Razor Form Validation from Render Action
I am new to MVC and trying to implement what I would expect to be a common problem. I have a simple search form that I want to implement on each page of the site. I want this section to maintain its own code so that I don't have to duplicate it on…

user1041169
- 639
- 2
- 9
- 18
2
votes
0 answers
Reuse views and controller logic in MVC3
in my MVC3 based application I often need to reuse the same functionality in different views.
Example: One view to search for users. Another view to show the search results and enable the user to select one or more of the returned records. At the…

bitfrickler
- 1,193
- 5
- 16
- 26