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 .
2,716
questions
1
vote
1
answer
43
views
How to reference dropdown in MVC Application
Please assist, I am trying to reference dropdown that I've coded in controller and used viewBag to get it in the view, but now I need to reference the view in my JQuery function.
Controller.cs
// GET: ...
0
votes
0
answers
21
views
how to add partial hbs file inside master hbs file in sugarcrm
My goal is to show multiple pages like wizard inside a popup in sugarcrm . solution i seems is to added partial .hbs file inside master hbs file .
i have gone through documentation
https://support....
0
votes
0
answers
41
views
Laravel trying to add custom css file inside a partial view with @include
In my Laravel project I want to that some of my partial views (like the header and footer partial views) to have their own CSS file but I just can't seem to figue out how to achieve that.
I've read in ...
0
votes
1
answer
50
views
Passing model data to partial view
When I create a partial view, and i want to get some model data, i get this error:
the partial view file is in Pages/Shared folder
the error says that the name Model does not exist in the current ...
0
votes
2
answers
82
views
Update partial view on non-MVC Asp.Net Core 6 RazorPages with Ajax
I'am working on a ASP.Net Core 6 Web application using RazorPages (no MVC). The RazorPage includes a partial view which I want to update after model-update. The model-update is done successfully by ...
0
votes
0
answers
23
views
C# MVC multiple loading javascript
everyone.
I am using NET Framework 4.8.1.
I'm having a problem when I try to reload a view, it's like it doesn't delete my javascript and going to reload it sends all the constants to me in error.
I ...
0
votes
0
answers
57
views
Is there any way we can use .cshtml partial view in a React web application?
I am working on a application that is built using the razor pages, react and angular, the basic design layout of the application is same, I have a problem where I need to use a dropdown component that ...
0
votes
1
answer
84
views
Partial form saving and loading without full page postback in ASP.NET Core 7 Razor Pages?
ASP.NET Core 7
Entity Framework
Deployed on Azure (App service and SQL Server)
I have three textboxes on a page. The text boxes can contain a substantial amount of text. Users will discuss with ...
0
votes
0
answers
32
views
Create a partial view in MVC c# that use a Javascript object with some parameter
I need to create a Partial View where I render a table created with the Tabulator.js library. The problem is that each table (Table Partial View) has different settings passed by javascript on table ...
0
votes
0
answers
35
views
Partial View Model Error (.net Framework)
I have this model in my view:
@model MGDanismanlik.Controllers.SettingsController.WorkCampClas
I call this partial view bottom of the view:
@Html.Partial("MonthlyResultPartial")
This is ...
0
votes
0
answers
18
views
Partial view in Dotnet application not appearing
I am having trouble with partial view in dotnet application i have been following Pro ASP.NET Core Identity book of Adam Freeman (Apress)
The Layout File look like the image below where i am calling ...
0
votes
1
answer
96
views
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 ...
0
votes
2
answers
203
views
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 ...
1
vote
2
answers
95
views
How can i show partial view with tuple?
I'm using a partial view in my program. How can i assign this partial to a value tuple and passing to my views in asp.net mvc 5?
this is my code but doesn't work
my controller
var op = checkBook....
0
votes
1
answer
52
views
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 ...
0
votes
1
answer
27
views
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 ...
0
votes
1
answer
533
views
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 ...
0
votes
1
answer
343
views
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.
...
0
votes
0
answers
76
views
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 ...
1
vote
1
answer
137
views
is it posible to use partialview with modal inside of another partialview and display the modal on the main page?
I am using a Partialview for displaying a table with data inside a normal razor page. I want to edit and first off all display a specific row of data with another partial view (Modal) When i am ...
0
votes
1
answer
34
views
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 ...
0
votes
0
answers
278
views
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 <div> from a button click using Jquery.
The script I have passes in a variable (Employee ID) from a textbox to return a partial ...
0
votes
1
answer
153
views
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 ...
0
votes
1
answer
654
views
ASP.NET Core MVC Master Detail in partial view
I am trying to do CRUD operations on a Master Detail model Department and Employee using modal popup. This is the code I used:
DepartmentController:
[HttpGet]
public IActionResult Create()
{
...
0
votes
0
answers
34
views
Why is my cshtml being broken by partial tags within an if statement block?
Probably quite simple, but I'm new to C# and Razor, and I'm having trouble finding an answer.
I have multiple links across my project that I want to display through partials. 95% of them are ...
0
votes
1
answer
22
views
Loading PartialView refreshes entire page using AJAX
At the core, I am trying to generate a table with links that can be clicked on a reload of a PartialView. Everything is working except I cannot get the page to stop refreshing. What I would like to ...
-1
votes
2
answers
442
views
View ['view.name'] not found
why I have this Problem please?
this is my blade code in laravel 9:
<form class="row g-3" method="POST" action="{{ route('users.store') }}" >
@csrf
@include(...
0
votes
1
answer
805
views
Pass current model to a Partial View in ASP.NET Core
I am working on an ASP.NET Core MVC application and i want to make CRUD operations using Modal popup. I used this code to display the Edit partial popup:
Index.cshtml:
@model IEnumerable<...
0
votes
2
answers
528
views
ASP.NET Core 6 MVC ajax render view in Body Section
I am creating an ASP.NET Core 6 MVC application.
In my _Layout.cshtml I have a menu that the option calls a method in the controller that renders a View in @RenderBody()
Simplifying, the menu is like ...
1
vote
0
answers
88
views
How to know at render time what partials are being used in a Razor page in ASPNET Core?
I have an ASPNET Core (.net6) project with a main page layout that automatically includes styles and scripts in the page bases on the page file name. Example: if you have a page called me/details (the ...
0
votes
1
answer
324
views
ASP.NET Core 6 Partial View "InvalidOperationException"
I want to show my create view into my main view which is index. So I take a partial view which is _Create.cshtml. But after calling the partial view, I get an InvalidOperationException.
This is my ...
0
votes
1
answer
50
views
Using PartialView to create dynamic MainMenu in _Layout Page - Asp.net core razorpage
i want to using PartialView in My _Layout Page
and this is my PartialView code:
@model List<WebApplication4.Models.MainMenuTable>
@foreach (var item in Model)
{
<li class="nav-...
2
votes
1
answer
337
views
View.RenderAsync() causes Cannot access a closed Stream exception
I'm developing net6.0 MVC app. I use partial view rendering to the string format in my app. I make Ajax request to the app and expect it to form a Json containing rendered partial view as a prop.
...
1
vote
1
answer
563
views
How to use IEnumerable with an object view model
I have a view that displays a user's first and last name in one model and another stores the url of their picture. All of that is connected to a view model and it gets displayed as single objects. ...
4
votes
2
answers
659
views
ASP.NET Core specific way to reuse Edit and New view content in cshtml
I have a New and Edit view that basically contain duplicate cshtml. What's the most efficient way to refactor so I can stay DRY?
I already looked through Stack Overflow, and all the answers I could ...
0
votes
1
answer
288
views
Razor page views with Partial (nested) views
I broke down bigger "Razor page" views into to "Partial" views.
From the main views I pass e.g. an image list to the partial view:
<partial name="/Partial/_ImageList.cshtml&...
0
votes
0
answers
552
views
Binding partial view to razor page model
I have a ASP.NET Core Web Application, using RazorPages.
I'm using a partial view for searching for a person. This partial view model (base PageModel) has a constructor with an interface to supply a ...
1
vote
1
answer
545
views
How to load a partial view from ASP.NET MVC application root into area view?
I have an area in my ASP.NET MVC application that needs to make use of partial views stored in the main application.
The code in question is being migrated from the main application into an area for ...
1
vote
1
answer
455
views
Custom View Engine not finding a view
I've successfully created a custom view engine and able to browse custom views that are found in different location other than the default. eg/Views/Module1/Controller/ViewName
Since my custom view ...
1
vote
0
answers
27
views
Why controller show only the PartialView
The GetUpdateTable function is never called until the first time I enter the page.
It should work that when I press a button the function GetUpdateTable should be called.
how should be
And one of the ...
1
vote
0
answers
67
views
Selected option doesn't update if it references nested property
I am using .NET Core 3.1 to develop an internal web portal. There is a simple form where whole form must be refreshed with new data if ProjectId is changed. Currently, there is only one field (...
0
votes
1
answer
240
views
Partial View loading using javascript : Possible XSS by HP FORTIFY
I have a js function , which Fortify identified as XSS vulnerable as below. Can you suggest any solution for this since the method is intensively used in my app.
I am here trying to call a partialview ...
0
votes
1
answer
98
views
Razor Pages: Page with partialview inside. How can i store my Data for the partialview?
Hello guys i am working on a projekt where i can add articles to a cart. My cart is a partialview.When i add a Article to my cart the old data isnt stored and only one (the new article) article is ...
0
votes
3
answers
131
views
How to call a controller Action passing id parameters from a modal partialView?
I have an ASP.Net Core MVC5 project with a view containing partialViews. In it I show a Bootstrap modal that loads data from a record in context. I need the identifier of this record to be passed as a ...
0
votes
2
answers
700
views
Is there a way to reload a single Partialview without loading the whole site? in asp.net Razorpages
Hello guys i wanted to ask if there is a way to reload a single partial after a is clicked instead of loading the whole site new.
My site looks like this.
My code
This is how i load my partialview ...
1
vote
1
answer
533
views
How do I capture the data sent by ajax in asp.net razor page?
I'm trying to populate a partial view with the data of the user i clicked on. Here is the code:
<tbody class="text-center ">
@foreach (var user in Model.UserList)
...
2
votes
1
answer
478
views
Why can't an interface in a tuple be used as the model in an ASP.NET Razor partial view?
I have an ASP.NET Razor Pages project with a partial view that uses a tuple type for its model. One of the tuple elements uses an interface as its type. When the partial view is called using an object ...
0
votes
2
answers
1k
views
Asp Net Core. Multiple partial views in one page. Passing Models and Calling Actions
I'm a student and new to working with MVC Asp.net.
I'm trying to create a booking system and would like to have all of the steps on one page, by using an accordion of sorts.
I'm trying to understand ...
0
votes
2
answers
330
views
how to fix delete record using partial view?
I want to delete the record from the table with modal but the partial view is not displayed in modal ...
How can I solve this problem !?
And that I can not use onClick !!!
this action for delete in ...
0
votes
2
answers
611
views
The view or its master was not found or no view engine supports the searched locations - Server Error in / Application
Error like:The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched:
*
~/Views/Home/Error.aspx
~/Views/Home/Error.ascx
~/...