Questions tagged [partialviews]
21 questions
10
votes
2 answers
How to use anonymous list as model in an ASP.NET MVC partial view?
I have a list of Contact objects, from which, I just want a subset of attributes. So I used LINQ projection to create an anonymous list and I passed that to a partial view. But when I use that list in partial view, compiler says that it doesn't have…

Saeed Neamati
- 35,341
- 41
- 136
- 188
5
votes
2 answers
How to replace a partial view by another?
I want to show a list of "Latest news" articles and, on click on "Read more" link, to show the full content of the clicked article. For that, I use a partial view in my Index.cshtml view. The first time the Index view is displayed, the partial view…

Furnica
- 199
- 3
- 15
4
votes
1 answer
Try to access a property of parent viewmodel in displaytemplate
I'm trying to build an asp.net mvc 4 application that makes use of partial views and display/editortemplates and Kendo ui.
I have a viewmodel for a specific page:
public class Plant {
public Guid PlantId{ get; set; }
public string Name {…

user1919031
- 85
- 1
- 7
3
votes
1 answer
Fields still contain form data when new model instance is passed to partial view
I have a partialview which post to server using jquery. The posting is working. However, when returning, I am returning partialviewresult with blank model (new model), but the return HTML is still containing the data previously post. Any idea on…

Alien-Y
- 33
- 3
3
votes
1 answer
render partial view in MVC
I am using MVC Structure. I have to create a report which can be filtered by drop downs. I am thing to use a partial view to display report.
HEre is the structure of the page I want to achieve.
On top of page, there will be some drop down…

Developer
- 183
- 2
- 2
- 10
2
votes
2 answers
No data-val* attributes with Partial Views
I have a view with Html.BeginForm() that calls a partial view(mentioned below and has no Form) passing in the main viewmodel. The Model has Data Annotation.
On initial load of the page validation works perfectly if I try to submit without selecting…

sagar
- 359
- 5
- 11
2
votes
1 answer
MVC 3 with Razor question about partial views
MVC 3 with Razor question about partial views.
I have this :
@model MvcGroupie.Models.Message
@{
ViewBag.Title = "Details";
}
Details
2
votes
1 answer
ASP.NET MVC Partial View with Form
I have a scenario I want to use a partial view but I'm having issues with it passing data to the controller. Here is a basic example of what I'm trying to do.
Objects:
Customer
Order
A Customer has an IList on it. I want the partial view…

cjibo
- 4,487
- 6
- 27
- 34
1
vote
1 answer
Models of anonymous types in partial views in MVC2
I've seen a number of examples that use an anonymous type to pass data to a view. I seem to be missing a crucial bit of information, though. Consider the following contrived example:
public class BlogController : Controller
{
public ActionResult…

Yes - that Jake.
- 16,725
- 14
- 70
- 96
1
vote
2 answers
MVC Partial View Javascript
I have a partial view created for re-use purposes. This partial view has a dropdownlist which uses Chosen plugin. Therefore, on the partial view I reference the chosen js/css file along with some javascript code to for document ready.
It works as…

NKD
- 1,039
- 1
- 13
- 24
1
vote
1 answer
Display multiple models in a single view using partial views
I need to is display data from a two tables(Student and Grade) in a single view index.cshtml.
I have two partial views _StudentPartial & _GradePartial both strongly typed. I googled around and everyone says that I parent model should be used. So I…

ceci
- 429
- 1
- 7
- 22
1
vote
1 answer
How to apply validation on multiple partail views which are bind to same property of model in mvc?
i am new to mvc. i have just encountered a problem. I have created a prtial view which has a texbox in it, which is bind to a property in a model. on that property [Required] validation has applied. the problem is that when i render that partial…

MVC Learner
- 13
- 2
1
vote
1 answer
Dygraph Y-axis interactive zoom fails if in programmatic zoom
I am using dygraphs for charting temperature and humidity values of thermal chambers taken at one minute intervals. I allow the user to programmatically specify the Y-axis extremes if desired.
If the temperature range is -40 to +100 degrees, the…

user2521531
- 21
- 3
0
votes
1 answer
MVC3 nested partial views submitt. how does it work?
I have started working with mvc3 pattern and am facing a problem.
The problem statement is some what as follows:
I have a partial view lets say MasterPartial which renders some content and is bound with a model named MasterPartialModel which…

Wajeeh
- 111
- 1
- 7
0
votes
2 answers
MVC3 .net Multiple Model or a Single View Model
I want to build a webpage which has 3 tabs (and thus 3 divs):
Tab 1 - Update Personal Details
Tab 2 - Check Order
Tab 3 - Change logon details
There are 2 ways to implement this as far as I can tell, but would like to know best practice.
First would…

user1079925
- 541
- 2
- 8
- 20