Questions tagged [partial-views]

User control in Asp.Net Web forms that is used for code re-usability. Partial views helps us to reduce code duplication . Reusable views like as Header and Footer views .

Partial view is like a regular view with a file extension .cshtml. We can use partial views in a situation where we need a header, footer reused for an MVC web application. We can say that it’s like a user control concept in ASP.NET.

2715 questions
0
votes
1 answer

How can I only display records which have not yet reached their expiry date (field)?

In my app I can add offers and give them a start and end date, the offers are displayed as partials. How can I go about only displaying them if the start date is todays date or earlier and the end date has not yet been reached? So far I have:…
Dave
  • 1,175
  • 2
  • 21
  • 49
0
votes
1 answer

How to update value at model from select list on partial

IndexModel is my home page and I get some data from _statusService that I render at the partial _MyPartial The problem that I have, is that in that partial I have a select list and I want to get different values based on the item that is selected…
Sachihiro
  • 1,597
  • 2
  • 20
  • 46
0
votes
2 answers

Disable button in parent view from partial view

I have parent view "index.cshtml" and partial view"_AddEmployeePartialView.cshtml". I'm currently trying to figure out how to disable a button "Add Employees" once the button "Save" in the partial view is clicked and partial view is closed of…
user4374239
  • 93
  • 2
  • 11
0
votes
2 answers

ASP.NET MVC 3 Razor Partial View - jQuery Included In Main Layout

A partial view that I'm using requires certain jQuery libraries to be included, and I'm currently trying to think of the best way to nicely add them. My current setup is as follows: _Layout.cshtml: ... @if (ViewBag.jQuery) {
JesseBuesking
  • 6,496
  • 4
  • 44
  • 89
0
votes
1 answer

MVC 3 StackOverflowException w/ @Html.Action()

I've looked over a bunch of other reports of this, but mine seems to be behaving a bit differently. I am returning PartialViewResults for my child actions, so that's not the source of the recursion. Here's a dumbed down version of what I have. //…
0
votes
1 answer

How to pass parameters from specific view to _Layout.cshtml?

I have a tool site, and the site layout was arranged like below. Black square has the main content, and when you go to a specific tool now I want to display the related tools on the right side. Now to avoid Col-md duplication on every page I…
Prageeth Liyanage
  • 1,612
  • 2
  • 19
  • 41
0
votes
1 answer

how to send JSON along with partialView using service?

in asp.net core I made a service to add new row and another one to update row. I call the service from the controller based on JS fetch request. now I need from the service response to return partialView and some Json like that var data = {…
0
votes
1 answer

Razor Pages - Updating a Model with AJAX and PartialView

I'm starting to study Razor Pages and using MongoDB as my database. I finished my CRUD operations, and now I'm working on my main page. But I can't understand how to update partially my page the first search (Default taking DateTime.Now) is already…
0
votes
1 answer

How can I stop showing a partial view on page load - ASP.NET MVC

I want to show a partial view when user clicks on a Button not on page load. I am facing an issue, partial view always comes on page load and on button click. I am not able to hide it on page load. This is _projectView.cshtml a partial…
R15
  • 13,982
  • 14
  • 97
  • 173
0
votes
0 answers

ASP.NET: Razor: Partial: @section: include multiple javascript files

I have an index.cshtml that includes a partial razor view called "_CustomPartial.cshtml". The view is rendered ok. I included 2 javascript files in my partial view that reference a div from my partial. This part isn't working. I think the scripts…
SoftwareDveloper
  • 559
  • 1
  • 5
  • 18
0
votes
1 answer

Partial Razor View not allowing to pass paramaters

I am currently trying to made a dynamic button row, featuring the ability to declare in a view which buttons you want rendering and then calling a partial razor view to render the content dynamically depending on parameters passed in. I get a null…
Dread Dev
  • 3
  • 2
0
votes
0 answers

How to Create Form with a Dynamic Repeating Partial View in .Net Core

I'm building a .Net Core application. The user interacts with a form that contains some general information. On the form there is a partialview that is dynamic. This section is populated based on the press of a button, and displays the same partial…
FlyFish
  • 491
  • 5
  • 22
0
votes
0 answers

Problem Slow PartialView rendering speed in ASP.NET MVC C#

I get a number of items through the web service and display them to the user in the form of Json through Jquery, the problem here is that I get the desired number of items very quickly from the desired web service, but when I want the desired items…
0
votes
0 answers

ASP Net Core Jquery Render Partial View Button click not working after first click

I've managed to work out how to render a partial View within a
from a button click using Jquery. The script I have passes in a variable (Employee ID) from a textbox to return a partial view containing an employee's details based on the entered…
0
votes
1 answer

Does the external CSS file of partial also start with '_' in asp.net?

I'm new to asp.net and have few questions. I have a module with Index.cshtml along with _Partial1.cshtml and _Partial2.cshtml in the same folder. Should I create individual external CSS file for each HTML file or use common CSS file per module? If…
Dhruvil21_04
  • 1,804
  • 2
  • 17
  • 31