948 questions
0
votes
1
answer
519
views
Renderpartial in a foreach loop only sends the first element in list
I'm trying to send a User in a list of users to a partial view but the partial view only takes the first user in the list. The code correctly displays the username and the actionlink to profile but ...
0
votes
1
answer
700
views
ASP.NET MVC - How to find out why Index-method is called?
I am currently working on an ASP.NET MVC web application using DevExpress controls and I ran into a very annoying issue that I could not fix so far.
I am implementing a page/view which consists of ...
0
votes
0
answers
108
views
Updating Bootstrap Validation on partial view that are load on change of dropdown value
I have a form, that contain a dropdown and this form is validated by bootstrapValidation(). when I change the value of dropdown, it loads a partial view with a list of text field. First time when I ...
1
vote
0
answers
12
views
Which is the best way to create a multiple Form in MVC (Separate pages or partial views in a navtab ) for customer
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#first" aria-controls="first" role="tab" data-toggle="tab">Your Product</a></...
0
votes
1
answer
106
views
'Amc' Name does not exist in the current context
<div role="tabpanel" class="tab-pane" id="second">
@Html.RenderAction("Amc", "UserController")
</div>
i am trying to add partial view in the index but it is not working. ...
0
votes
0
answers
109
views
html helper don't get values back from controller after ajax.beginform
I have a ajax.beginform that I have to upload a file and then in the view I have hidden for the path of the file that have been
saved in the server.
The problem is that the value of the path doesn't ...
-1
votes
1
answer
62
views
How can I force a user to select something from a dropdownlist before showing anything from the website and store that value as a "global" one?
I am building an ASP.NET Core MVC app (build v2.1.0).
I want the users of the application (I don't have any authentication, so anyone can be user) to be forced to select a value from a drodownlist (...
0
votes
1
answer
2k
views
Ajax paging in ASP.NET MVC with Entity Framework
After a lot of help from stack overflow I was able to create CRUD operations and used partial view to render my index page for searching, but now I'm lost how to begin for paging.
For searching I ...
0
votes
2
answers
1k
views
Ajax searching and paging in ASP.NET MVC using Entity Framework
I was able to create CRUD operations with searching and paging in ASP.NET MVC using Entity Framework, now I want to use Ajax for searching and paging.
What would be the steps to create it?
Here is ...
0
votes
0
answers
82
views
Asp Net Mvc: Can JSON data be returned from Partial View?
I want to do something like this;
- I'll send a Post request to an action(partial view or something else, i don't know) method with javascript.
- Before this action will show me a partial view.
- ...
0
votes
1
answer
2k
views
Load partial view as modal on button click
So I'm trying to load, after I click on a button, a partial view from controller, containing a bootstrap modal.
I'm not sure where the problem is, but when I click the button the first time, the DOM ...
2
votes
3
answers
594
views
How can I create layout page for partial views in asp.net MVC?
How to create one layout page for a partial view?
Simply in MVC we create _layout.html and configure in viewstart.html page for all view. But in this partial views case how I'll do?
If you know a ...
4
votes
1
answer
1k
views
Pass inner HTML to Partial View in ASP.NET Core MVC 3
I'm sure this question has already been asked but don't know how to phrase it correctly. I want to do something like that:
MyView.cshtml:
<partial name="_MyPartial">
<span>some ...
-1
votes
1
answer
105
views
how to show 2 partial views on the same page
I just started using asp.net mvc and I have a question. In my current project which is the login forms and registration forms that microsoft give as example, I have a log in page and a register page ...
0
votes
1
answer
930
views
Is it possible use some JavaScript on a Partial View in ASP.NET MVC?
I am new on .NET MVC and on StackOverFlow, probably you will disdain on the approach that I am using, but I am a little bit confused.
The situation is this: I have three partial view with their own ...
0
votes
1
answer
668
views
Duplicate Events from Jquery when loading partials views
I have table with a button per row each button can get the same partialview with diferent objets same model, and I insert the html into a Div, the partialview have a Jquery on click event.
Something ...
0
votes
2
answers
376
views
return minified partial view from action
I am currently building an ASP.Net Core 3 MVC application. It is a pretty simple Task, I want to return a partial view, but minified in order to save bandwidth.
My current code looks something like ...
1
vote
1
answer
2k
views
Html does not exist in current context. Can I use html class in web forms using Web View syntax?
I am programming an app that has some sections in WebForms and some in MVC. I have a Webform.master and a Site.Master. When using the Html class, My Webform.master in visual studio says "The name ...
0
votes
1
answer
56
views
The Model Passed to Dictionary is of one type whereas the Dictionary Requires Model Item of Type ViewModels
I am working with the partial views to attain a functionality in which I have to delete data from two tables having a one to many relationship in database. For this, I am using same “Delete” function ...
0
votes
0
answers
61
views
How to post view model to controller
I am trying to create a view that takes a view model, simply has an int property and a list of child model, with int; string; string properties.
What i am trying to do is everytime user clicks an "...
0
votes
1
answer
70
views
Convert a partial view to HTML 2019
Been at this for weeks. Something simple has become beyond difficult for no reason. All I want to do is return the HTML of a partial view. Why?
Rendering multiple partial views on one page in Azure ...
0
votes
1
answer
1k
views
How Can I Render A Partial View Inside an Editor Template?
I am using an edit template for Kendo scheduler called ScheduleEditorTemplate.cshtml which his located in Views/Shared/EditorTemplates
I have a partial view named _POC.cshtml and I need to display ...
0
votes
1
answer
527
views
How to pass display name of table header to partial view
I am trying to pass the table header name to a partial view because I want to display some sorting and search controls for each table header.
This is my partial view:
@model string
<div class="...
0
votes
1
answer
39
views
HttpException: A public action method 'ListCheckListType' was not found on controller
I checked all the solutions but still doesnt work.I got a partial view page in layout page and When ı run only partial page it works but when ı run another page with layout it doesnt work.
I hope you ...
0
votes
1
answer
232
views
DropDownListFor is not showing in my modal, while my selectListItem isn't null
I'm trying to put a DropDownList in my PartialView which is showing in a modal.
But, even if my SelectList is populated, nothing appear, on the screen and when I inspect the element.
(By the way, my ...
1
vote
1
answer
1k
views
Data from partial view not posting
I have the following page :
<form method="post">
<hr />
<h4>Alert</h4>
<div class="card-overview">
<div class="card-columns">
<partial name="_Alert" ...
2
votes
1
answer
1k
views
How to validate a form without returning a view in asp.net?
I made a dropdown menu where a use can log in from the navbar instead of pressing the login button and being redirected to account/login. This was done in a partial view and is rendered in the navbar ...
0
votes
4
answers
2k
views
I need to run Action Method in Partial View but it redirect me to another action
I need to run Partial View from action method as a child action method but it redirect me to another view.
1- I tried to use Html.Action("myAction","myController") and I use [ChildActionOnly] data ...
0
votes
2
answers
1k
views
Load partial view through controller on Search button click
I am working on an ASP.NET Core 2.1 MVC app using razor. I have searchQuery.cshtml and a (individually working perfectly) viewQuery.cshtml pages. In my searchQuery page, I let user enter queryId and ...
1
vote
1
answer
2k
views
Returning a partial view from controller with proper id and name in inputs
I'm developing a web MVC application with net core 2.2.
I have the following classes:
public class A
{
public IList<B> Bs { get; set; }
}
public class B
{
public string Id { get; set; ...
0
votes
1
answer
1k
views
Refresh Existing Grid (PartialView) with New Data on Ajax Call
I have a PartialView which renders a Grid using a List of Model Class passed from the controller.
@model IEnumerable<DeliveryDashboard.Models.UpcomingDMR>
@Html.Partial("~/Views/Shared/...
-1
votes
1
answer
202
views
Partial view in ASP.NET always outside of <tr>
I am trying to render my partial view inside table row (which is inside thead tag) but I`m always have the view rendered outside of the row . Here is the code:
<tr id="lineTimes">
...
1
vote
1
answer
893
views
MVC 5 dynamic model in partial view
I have a few (around 6) lookup tables like degreetype, categorytype, etc. All these table has similar column id, name and isactive fields. I created CRUD stored procedure for each table.
In my MVC5 ...
3
votes
0
answers
2k
views
How to load a Data Table in a Partial View
I have a partial view that is loading a data table. When I debug, I'm able to step into the partial view and watch the data table get built. Everything seems to work fine except nothing happens when ...
1
vote
3
answers
580
views
Model in Partial View Did Not Return Any Data
I'm not quite sure what I missed here. I have call a Chat Controller in _Layout like below :
<div id="ChatContainer" class="chat-popup">
@Html.Action("Index", "Chats")
</div>
The ...
0
votes
0
answers
55
views
Button in partial view takes the page as bottom on first load
I have an Ok-Button in a Partial View. The CSS looks like this:
#okGroups {
margin-top:100%;
position: absolute;
width: 250px;
height: 50px;
bottom: 20%;
right: 380px;
...
0
votes
1
answer
978
views
The name 'model' does not exist in the current context when referencing Partial View in /bin folder
I have the following:
Html.RenderPartial("~/bin/Views/SharedViews/_PartialView.cshtml", model.SharedViewModel);
This partial view is coming from another project that I have set as a reference; that ...
1
vote
0
answers
118
views
Linked Partial View Not Found By MVC
Given two projects:
Project.Common
> Helpers
>> _PartialView.cshtml
Project.FirstProject
> Views
>> Shared
>>> (linked) _PartialView.cshtml
I have added a linked reference ...
0
votes
1
answer
504
views
Html.Partial causing 404 in MVC Views
I had previously asked a question about a 404 error being thrown but thanks to help from folks attempting to help me debug, I now have a more specific question to ask.
I see the following error when ...
0
votes
0
answers
217
views
After loading my Partial View via Ajax call more than once, my Kendo Window looses closable:true
I have a Kendo Window where I load a partial view via an Ajax-Call as content.
When first loading the the Partial View, everything is ok. (The Kendow Window is closable, like I want).
But when I ...
0
votes
1
answer
222
views
What is the best way to pass a variable to a partial in the layout about the current page?
I've implemented a huge template to a new .Net Core MVC app and have separated it to various partials (header, sidebar, footer).
It works well - however, the side menu bar is meant to have
<li ...
0
votes
0
answers
351
views
Pass value from jQuery to Bootstrap modal-body
I am trying to pass a model to a bootstrap modal editor. I call the modal from an Ajax method. I can get the model from the controller, and view its properties from the script's success event. However,...
0
votes
3
answers
377
views
Are partial views a good way to restrict user access?
I have used partial views in the past to split up large views. However are they a good way to restrict user access? Can the partial view be accessed at all by unauthorised users in my current setup.
...
0
votes
3
answers
83
views
Use some PartialView with post action in view?
There is a view for registration that has two PartialView in jquery tab (register by phone or register by email).
I was Called those in Parent view with below codes:
<div id="tabs" class="tabs">...
1
vote
1
answer
157
views
System.Web.HttpParseException: 'The code block is missing a closing "}" character
I am facing some issue with razor syntax to pass list of string with partial view. Here is my code :
<ul class="nav navbar-nav">
@{ IList<string> model = new List<string> {"...
0
votes
1
answer
187
views
Datatable in a partialview is aligning right after loading it by ajax request
I loaded datatable from a partialview. when it loads with a controller it works fine and remains in correct position. But when I reload the datatable by calling ajax the datatable aligned to right.
...
0
votes
0
answers
103
views
Update gridview inside a partialview modal
I am having problems rendering a gridview with pagination on a modal. Whenever I click other pages, it doesn't render the modal at all. Just text with formatting of the next page. For now, these are ...
0
votes
1
answer
296
views
MVC PartialViewResult not triggered on Dropdownlistfor changed event (event is triggered, PartialViewResult is not)
Hi all and thank you for reading this.
I have the same scenario already working thanks to Stephen Muecke his answer
The only difference here is that i don't want a Partial view loading data from a ...
2
votes
1
answer
1k
views
How to load div with jQuery AJAX and setInterval in MVC 5?
I am working with jQuery Ajax. I want to load data of my table every 5 seconds. Here's what I tried but it's not working. It doesn't return any error or result.
public ActionResult Index()
{
return ...
0
votes
1
answer
1k
views
How to access elements in a PartialView (loaded via an AJAX-Call) from a js-file (working with ASP.NET MVC5, Kendo-UI)?
UPDATED --
I have an 'index.js', that script is rendered in Index.cshtml.
Index.cshtml has a <div id="main"> *KendoPanelBar here* </div>
I successfully load my Partial View into the ...