Questions tagged [html.renderpartial]
24 questions
80
votes
5 answers
asp.net MVC partial view controller action
I'm very new to web app development and I thought I would start with recent technology and so I'm trying to learn asp.net as-well as the MVC framework at once. This is probably a very simple question for you, MVC professionals.
My question is should…

yogibear
- 14,487
- 9
- 32
- 31
7
votes
3 answers
ASP.NET MVC - Can a Partial View have a controller?
When I'm in a View and I call @Html.RenderPartial("MyPartialView", MyObject) Can I set it up so that this partial view has a controller which is called when RenderPartial gets called?

dev.e.loper
- 35,446
- 76
- 161
- 247
5
votes
1 answer
Mvc Render Action/Partial to Response Output
Although @Html.RenderPartial calls write and returns void, it is still writing to a StringWriter/StringBuilder. Is there a way to render directly to the ResponseStream?
Can this be done with a custom IViewEngine that implements render like PdfView…

Steve
- 1,995
- 2
- 16
- 25
4
votes
1 answer
Difference between Html.RenderPartial and Html.Render
I am new to asp.net and im have a page that i want to show as a partial view.
The page is in a div tag ,like this
Html.RenderPartial("view",Model)
and im doing the same thing with Html.Render but it works just with RenderPartial.
Does…
Bafla13
- 132
- 2
- 11
3
votes
3 answers
What's the overhead of including RenderPartial in an MVC3 page
I am trying to optimize my code as much as possible. I use a lot of partial files like this:
@if (Model.PageMeta.Sidebar == PageMetaSidebar.Small) { Html.RenderPartial("_SmallSidebar"); }
..
..
..
Can someone tell me if there is a performance…

Janese
- 741
- 1
- 6
- 6
3
votes
1 answer
Render Partial View with Object Model using jquery / Ajax
My current code looks like
{
// some code
@Html.Partial("~/Views/AdminUser/Main.cshtml", Model.AdminUserModel)
}
however, i need this to instead be an ajax call. How do I do an jquery ajax call where the model is…

Kevin Scheidt
- 95
- 3
- 10
2
votes
2 answers
How to put a Partial View into a div in JavaScript (with jQuery)
I have ,MyPartialView.cshtml':
and an 'index.js'.
The 'index.js' should do sth like:
$('mainDiv').html($('#partialDiv'))
to put the partial view into the main…
some content
an 'index.cshtml':

thestruggleisreal
- 940
- 3
- 10
- 26
1
vote
2 answers
RenderPartial not rendering inside of div
Hi I'm having some issues understanding how MVC 3 and razor work. Basically, I have a view that's rendered with Html.Render partial. basically, I'm trying to render the contents or a partial view inside of div like so.

dalcantara
- 1,613
- 2
- 21
- 35
1
vote
2 answers
Html.RenderPartial - Render Partial View located in another folder
I have my view 'Create.cshtml' in folder Views-Department. I want to use partial view which is located in folder on root, 'CommonViews' with the name '_EnterpriseStructure.cshtml'.
I am using syntax RenderPartial
…

pkp
- 11
- 2
1
vote
1 answer
RenderAction or RenderPartial dynamically
I have this view that has the following code:
@model ComPost.Core.CommandsAndQueries.Contract.DataContract.DepositDetailDTO
@section scripts
{