Questions tagged [asp.net-mvc-partialview]

A partial view enables you to define a view that will be rendered inside a parent view. Partial views are implemented like as user control in Asp.Net Web forms that is used for code re-usability. Partial views helps us to reduce code duplication.

0
votes
0answers
10 views

ViewComponent vs Views vs PartialView

I am developing a .net core application and following all the new principles and techniques that have moved on from MVC5 over to MVC6 (.net core). An area that I have questioned is the view component. ...
0
votes
1answer
14 views

Mvc 5 open modal in layout for register httppost goes wrong target partialviewresult

I have create a partialview for my modal.In partialview I have create my register form.I am opening register modal and click register it doesnt goes to right target in my homecontroller. And the ...
0
votes
2answers
36 views

ASP.NET Core MVC submit form in partial view / ViewComponent

I have a menu and a content area which displays content based on the selected item in the menu. Since the user is allowed to change the structure of the main menu, I decided that everything will be on ...
0
votes
1answer
49 views

Asp net core mvc model details not validating and passing values to controller

In the Edit method of a controller, I cannot successfully validate and pass the details of a model. But when I add new row, it validates and pass it's values to the controller. Here is the sample ...
1
vote
1answer
39 views

Generically Render Partial View - Convert PropertyInfo into Concrete Object

I am currently making a wizard in MVC (c#). But I have an if statement in my Wizard view that goes like this: if (Model.Wizard.ClientDetails.GetStep() == Model.Wizard.CurrentStep) { @Html....
0
votes
2answers
43 views

Passing Value from URL using RenderPartial to another View

I have a View which uses @Html.RenderPartial for showing some data which is present on another View. I want to send an ID present in the URL into the RenderPartial so that it can be utilized on the ...
0
votes
1answer
20 views

PartialView is returning fullpage, only rendering the form

I'm trying to rerender the partialview ONLY in my modal, after the ajax request. But when I get the response everything is rerendered and the only thing showing is the partialview.. PartialView: @{ ...
1
vote
2answers
25 views

Javascript MVC Deleting after space

I am working on a pretty simple MVC project. I have a div that when clicked passes a string to a javascript function. The javascript calls a partial view and fills out a bootstrap modal with it. ...
0
votes
0answers
23 views

Update partial view with complex model

I have a main view with a lot of dropdown lists as filters. These filters are used in the controller to retrieve datas from database (complex query). After retrieving datas I want to update a partial ...
0
votes
0answers
11 views

How to add counter of specific rows in DB to MVC _Layout [duplicate]

I am working on a website with a shop. As part of the _Layout section I want to have a counter of items that have been put into a shopping cart, obviously I have chosen _Layout to ensure the counter ...
0
votes
2answers
69 views

How to pass data from partial view to main controller - ASP.NET MVC

I am new to ASP.NET MVC. I did a partial view where I am showing a checkbox dynamically. My question is how can I get the value of the checkbox and send the values to main controller? I don't know ...
0
votes
0answers
8 views

System.Web.MVC version 4.0.20710 taking more time to execute a method than usual

public virtual ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache); Set useCache=False This dll is taking more time to execute than usual and ...
0
votes
1answer
41 views

Update partial view in controller

I'm working on a new project with asp.net MVC5. In this project, I have unlimited categories with unlimited subcategories. I want to convert my categories + categories children to menus. I know that ...
0
votes
0answers
19 views

Fill Model in partial view and return the data to Partial view and bind data in asp.net core

I am filling some data which i require on Partial view only. I am filling the model in Action used for Partial view as below: public PartialViewResult FetchCategoriesForHomePage() { ...
0
votes
1answer
40 views

Updating Table In Partial View

Goal: Attempting to create a feature where a table is updated with added rows from the database. I'm running into an issue with how the views are formatted, my knowledge with javascript and MVC isn'...
0
votes
0answers
6 views

Rendering Partial view to display form controls on button click in same parent view

I have created a form to submit details and the form looks like this: Here in the form, on click of add member button we should be able to add one more household through the same form. I decided to ...
0
votes
1answer
26 views

ASP.NET MVC common part of page, how to make better

For example, many pages on the project have similar part, which requires to get data from controller. We can create Partial View for it: View Model class: public class DriverProfilerSidebarVM ...
0
votes
1answer
26 views

I want the models in partial view and index view to be different

They want me to make a page dynamic. There are slider, galery, form and subscribe sections in the page. I need to associate these partitions with the database. I divided these parts into partials. I ...
1
vote
1answer
263 views

ASP.NET Core Razor Pages | can partial views have page models

I have a partial view called _Subscribe.cshtml Is it okay for partial views to have a page model _Subscribe.cshtml.cs? I want to allow people who visit my website to be able to subscribe to keep up-...
0
votes
0answers
94 views

Calling normal method in Asp.net MVC to insert record without ActionResult redirect

Here is my scenario. I have a main view with a datatable. That datatable has a child record that contains a partial view that is loaded when clicked. That partial view has its own button created to ...
0
votes
1answer
35 views

ReportViewerForMvc PartialView exception

This is my _ReportViewer.cshtml partial view: @using ReportViewerForMvc @Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, new { scrolling ="no", style ="width: ...
-1
votes
1answer
101 views

How to bind html elements with dynamically created ID to jQuery events in asp.net MVC

I am iterating 3 times over a partial view in the Razor syntax. The code goes like this: foreach(var item in Model.items) //Will be run 3 or more times { {Html.RenderPartial("_viewname", item)} } ...
0
votes
0answers
114 views

Access element in partial view

I'm populating a table that is inside a partial view. The partial is rendered and the content is passed to the wrapper div via ajax. $("#Add").on('click', function (e) { e.preventDefault(); ...
0
votes
0answers
36 views

How to add MVC Parital view to CkEditor

I need help,Want to add MVC Partial view (Contact) form to ckeditor tools. Or If any possibility to add short codes in ckeditor tools like word press and Umbraco CMS.
1
vote
0answers
20 views

How to client side validation for list of viewmodel in mvc 5? [duplicate]

I want to validate the list of viewmodel but it is not working as expected however it is work for only viewmodel. Here are the my codes 1) HomeController.cs public PartialViewResult ...
0
votes
0answers
18 views

MVC: Error Page opens inside of the main layout when exception thrown in the controller method

Thjere might be similar questions here and I thing I saw some solutions already, However, it does not seem to be what I'm looking for. I want to display an error page in its own custom layout. That ...
0
votes
0answers
63 views

How to Post partial view to controller without updating the current view?

I have an ASP.Net MVC 5 SPA in which bootstrap dialogs containing Partial Views are rendered on top of the main index.cshtml page. When the submit button is clicked on the modal dialog, the partial ...
1
vote
1answer
50 views

How to Update the Model in MVC 5

I have a Markdown editor in my MVC 5 application.Here is the code: <script type="text/javascript"> var executivesummary = new tui.Editor({ el: document.querySelector('#Recommendation'), ...
0
votes
1answer
34 views

Passing variable from Partial View to JavaScript

I am dynamically inserting a Markdown editor in Partial view based on the id passed to the Partial View. @Html.Partial("_MarkdownEditor", new { id ="editorsection" }) var @ViewData.Eval("id") ...
0
votes
1answer
70 views

How to use Parameters passed to Partial view in a separate javascript file

I have a Partial view which takes in parameters and displays a Markdown Editor based on the parameters passed. @Html.Partial("_MarkdownEditor", new { id ="fieldsection" }) <div id="@ViewData.Eval(...
0
votes
0answers
24 views

How to reference Parameters passed to Partial view in a separate javascript file?

I have a Partial view in a view which take in parameters like this: @Html.Partial("_MarkdownEditor", new { id ="editorsection" }) @Html.Partial("_MarkdownEditor", new { id ="fieldcomments" }) In ...
0
votes
1answer
31 views

How to dynamically Set Query Selector attributes

I have a Partial view with Markdown Editor i reference this Partial View in Main view along with the id attribute. @Html.Partial("_MarkdownEditor", new { id ="executivesummary" }) @Html.Partial("...
0
votes
3answers
223 views

MVC 5 Partial view with Html attributes

I have partial view inside a View in MVC 5.This partial view renders a Markdown editor in different section of the main view. Here is the Markdown Editor code in Partial view. <div id="field ...
0
votes
2answers
46 views

How can I displaying view with AJAX call from PartialView?

I am using PartialView and I am displaying 3 news in partial. I am sending news id from partialview to my action result. When user clicked, they can read news which is clicked. My ajax call return all ...
0
votes
0answers
33 views

LINQ not returning correct data

I am using PartialView in my project. I want to get parent menu and sub menus of parent. When I clicked submenu, I can take menuID but I can't reach children items exactly. For Example, I clicked ...
0
votes
0answers
35 views

MVC - After dynamic Partial Load, SubModel doesn't update for save

I have a Model which is in a PartialView _Model.cshtml and it has a SubModel which has a partial view _SubModel.cshtml. When you switch an item in a drop down list, i'm sending an Ajax call to ...
0
votes
1answer
205 views

render partial view on same page

In my navigation bar, I have Search <li><a href="#" class="callSearch">Search </a></li> I am making Ajax call, to go to different projects controller $(".callSearch")....
0
votes
0answers
61 views

ASP.NET MVC 4 button on click load Partial View inside Main View

As shown in the image I need help with loading the Partial View below the main view on button click when I select team from dropdown and hit "select" button. Right now my partial view is loading on ...
1
vote
0answers
109 views

Uncaught TypeError: Cannot read property 'settings' of undefined at HTMLInputElement.delegate

I am new to Asp.net Core MVC. I have a view with validations from which I call a partial view using Jquery and ajax. The partial view displays correctly but the vaidation is not working in the partial ...
0
votes
0answers
53 views

How to create Independent Html.PartialView in Style Files

Controller and Action public class RentCarController : Controller { public ActionResult Cars() { return PartialView("Cars"); } } Cars.cshtml: <script src="/plugins/...
0
votes
2answers
268 views

Using JQuery Tabs inside a (MVC) Partial View

I have a partial view that renders a bunch of controls, and I also want it to contain a series of JQuery Tabs. The tabs render fine: <div id="comment-tabs"> <ul> <li&...
0
votes
1answer
110 views

How to pass Anchor Attribute to Partial View call

Got a question and hopefully someone will answer. I am working on an MVC Core project. I have the following cshtml code: @foreach (var idea in Model.Ideas){ <a name="@idea.IdeaId" href="#">...
0
votes
1answer
179 views

How to use RazorGenerator in project? [closed]

I want to use RazorGenerator for use partial view beetwen project in mvc. I search many website but i dont find anywhere. I added my project with nugget packages and after what am ı doing ? Please ...
0
votes
1answer
373 views

How to load another view as PartialView when the current View loads?

I am relatively new to this. I am working on this ASP.NET Core MVC project where I want to load a PartialView, HistoryTable.cshtml in a <div> in the current Main View when the Main View, Locate....
0
votes
1answer
34 views

How to load View with PartialView already loaded in it?

I am working on this ASP.NET MVC Core project where I want to a View to be rendered on the screen with the PartialView already rendered in the View. In other words, I have the following View: View:...
-1
votes
2answers
49 views

MVC Partial View Returns fine in dev but fails in live with 404 error

I am sending an ajax call on on a button click to load a partial view in Kendo Modal window. In dev mode it is doing everything fine as expected but giving me a 404 error in live. Following is my ...
-1
votes
1answer
45 views

Ajax Form returns null on CSV upload

The way this is setup is, -There is a View which takes the CSV upload -There is a Controller Partial View Action which is supposed to retrieve the parse the CSv and read the objects from the CSV and ...
-1
votes
1answer
165 views

Posting a search form via Ajax in ASP.NET MVC results in 500 (Internal Server Error)

So the way I have got this setup involves ClientController in the Controllers Folder. And in the Views Folder, I have SearchClient.cshtml and _SearchClients.cshtml. I am using Ajax and following the ...
0
votes
0answers
72 views

ASP.NET MVC Partial view JavaScript move to Main view

I'm lost with so many examples and solutions out here I cannot seem to find anything that makes sense to me. So, I'm going to take a baby step and ask How do you move JavaScript file reference from ...
0
votes
0answers
58 views

ASP.NET MVC dynamically add existing (stand-alone) view as a Partial

Does anyone know how to load an existing (stand-alone) view as a partial view? I found a tutorial at this link (gillesleblanc.wordpress.com/…) but it looks more complicated than I think I need. I'm ...