Questions tagged [html.renderpartial]
24 questions
1
vote
0 answers
Generate N user controls (partial views)
I am trying to migrate a project from web forms to mvc. I need page(view) where i can render N partial views and submit the data. Model should look something like this:
public class ContactInfo
{
Contact customer{get;set;}
…

kjanceski
- 11
- 3
0
votes
1 answer
Model values not carrying into partial view from main view- C# MVC
I've been stumped for days.
I have an index page that contains a renderpartial view. A viewmodel is passed to the index page from its controller, then passed from inside the index.cshtml to the renderpartial view as an extension. The…

Jason Beck
- 23
- 7
0
votes
2 answers
C# ASP.NET MVC error sharing model between parent and child view using Html.RenderPartial
While invoking @Html.RenderPartial("_ChildPartialView"), I am getting the following error :
System.Collections.Generic.ICollection' has no applicable method named 'ElementAt' but appears to have an extension method by that name. Extension methods…

Sujoy
- 1,051
- 13
- 26
0
votes
1 answer
RenderPartial does not exist in System.Web.Mvc.Html but RenderPartialExtensions does in cshtml
I want to embed other cshtml views into my main view. After doing some research I found that Html.RenderPartial can be used for this purpose. But I'm not seeing RenderPartial and only getting RenderPartialExtensions.
I'm using System.Web version…

aa100
- 31
- 1
- 4
0
votes
3 answers
Yii2: don't show footer for some views
I want to not show the footer of a typical Yii view.
The function that render the view is very short:
public function actionPrintReport() {
return $this->render('_myReport', []);
}
How can I hide it?

Roby Sottini
- 2,117
- 6
- 48
- 88
0
votes
3 answers
Yii2: How to renderPartial with Bootstrap classes?
I am trying to use renderPartial function and Bootstrap classes.
This is my function in the controller file:
public function actionPrintReport() {
Yii::$app->response->format = 'pdf';
return $this->renderPartial('_myReport', []);
}
This is…

Roby Sottini
- 2,117
- 6
- 48
- 88
0
votes
0 answers
C# ASP NET MVC 5.0 Postback goes to Html.RenderPartial() on View Model Validation Error
I have an unexpected post back to a Html.RenderPartial() action when the main page fails model data validation. If there are no errors with model validation the page posts back to the expected controller action. Has anyone run into this and what…

CodeBon
- 1,134
- 8
- 9
0
votes
1 answer
Using an object returned from Html.RenderAction
I am using Html.RenderAction in my View to call a method that is in my controller. The controller method returns a custom object, I want to know how would I be able to use this returned object in the view.
View
//at the top
@model…

TheProgrammer
- 1,314
- 5
- 22
- 44
0
votes
2 answers
Object reference not set to an instance of an object - Partial View
I have a strongly typed partial view which is giving me "Object reference not set to an instance of an object" error when I launch the master view. I know I am not passing in any parameters yet, but is there a way to handle this error?
Master…

user793468
- 4,898
- 23
- 81
- 126