377 questions
0
votes
0
answers
39
views
Kendo UI MVC Grid Column: Make Object Property Filterable, Editable, and Sortable
I am using Kendo UI MVC in a .NET application and have a grid where one of the columns is bound to an object property. The column should be filterable, editable, and sortable.
The column is bound to ...
0
votes
1
answer
510
views
IFormFile property in ViewModel is NOT binding
When I try to post QuizCreate view model which contains List<IFormFile> property, it's not binding and is always NULL.
I have a view model for POST form QuizCreate.cs :
public class QuizCreate
{
...
0
votes
1
answer
94
views
Ajax call is not performed inside a nested editor templates in MVC
I'm trying to create a web app Admin tool for creating/editing quizzes, that can be fully adjustable (with ASP.NET Core MVC).
What I mean by fully adjustable:
Admin user can add/remove any number of ...
0
votes
0
answers
692
views
Kendo UI MVC grid not seeing Model.Columns data
Hey all I am using Kendo UI for ASP.NET MVC version 2022.R1.SP1 and I have populated a grid with one row:
The above screenshot grid works only when I comment out the FOREEACH statement in the code ...
2
votes
0
answers
435
views
How to get input data to controller with custom objects in ASP.NET MVC
I'm trying to make an EditorFor and Editor Template for a custom class that maps to a drop down UI element. The idea is to select n-number of items from the collection and then process those ...
1
vote
0
answers
29
views
.NET MVC error in EditorTemplate calling another EditorTemplate
I have a Aviewmodel that contains a child SignViewModel.
and a Bviewmodel that also contains a child SignViewModel.
AViewModel:
public int id { get; set; }
public string name { get; set; }
//nav props
...
1
vote
0
answers
309
views
ASP.NET MVC 5 Editor Templates
I'm trying to build some semi-generic editor templates to reduce the amount of repetitive layout HTML I write, i.e., handling label, input, validation message, etc. I want to use them with EditorFor ...
0
votes
0
answers
57
views
Custom editor templates not being called
I have an MVC application using a number EditorTemplates and targetting .NET Framework 4.6.1. I have one that I want to use to render an Enum as a set of radio buttons my users can choose from.
In my ...
1
vote
1
answer
45
views
[MVC][Razor] Exchange data between editortemplates
A bit new to using EditorTemplates and stumped on the following:
I have a multi layered (view)model, simplified like this:
public class MyModel()
{
public MyFirstSubModel MyFirstSubModel { get; ...
1
vote
1
answer
313
views
EditorTemplate asp-for="Property" vs value="@Model.Property"
I am using .NET Core 3.0 to build a web application which contains an EditorTemplate for a list of values. This EditorTemplate is inside a PartialView. A PartialView is returned from my ActionMethod ...
0
votes
1
answer
63
views
MVC EditorTemplate binding not work for 2 elements in same page
My page displays, side by side, to arrays of objects of class ExternalExeWorkerSettings.
To render de objects i created a Editor Template for the 'ExternalExeWorkerSettings'.
The page is correctly ...
0
votes
1
answer
327
views
ASP.NET Core Running Multiple Templates when using @Html.EditorForModel()
I have an EditorTemplate for booleans:
@model bool?
<div class="form-group">
<div class="custom-control custom-checkbox ">
<input asp-for="@Model"/>
<label ...
2
votes
1
answer
296
views
How can I make a fancy checkbox template for ASP.NET Core?
I've got a lot of booleans in my model, and we're using Bootstrap, so for every boolean property I'm copy/paste refactoring:
<div class="form-group">
<div class="custom-control custom-...
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
652
views
Kendo().ComboBox does not retain selected values when inside of a Kendo().Grid's Editor Template when moving the focus away from the row
I've been struggling with that for a while and cannot figure out the solution.
When display Kendo().ComboBox inside of a Kendo().Grid, it is populated with the data.
However, when changing the value ...
0
votes
1
answer
98
views
Safely Reuse Editor Templates Across Different Types
Suppose I have the following partial view for Decimal located at "~/Views/Shared/EditorTemplates/Decimal.cshtml":
@model decimal?
@{
var attrs = ViewData;
if (ViewData["type"] == null)
{
...
0
votes
1
answer
410
views
In Editor Template, Kendo Combobox DataSource does not hit the Controller method to populate the combobox
Editor Template has a Kendo.ComboBox() with the DataSource reading from a Controller:
.DataSource(source =>
{
source.Read(read =>
{
read.Action("TheController", "TheMethod")....
0
votes
1
answer
228
views
EditorFor with Enum named Color not using editor template
I have a property named Color of type Enum named Color, and I'm trying to use an editor template. My enum editor template is:
@ModelType System.Enum
<div class="form-group">
@Html.LabelFor(...
1
vote
3
answers
717
views
Why won't my Edit screen validation allow null?
I added a field to a view model for a Document that should allow the user to associate it with a Tenant. It works fine if the user does assign a tenant, but if they select the null option from the ...
1
vote
0
answers
252
views
Add Editor templates row by row to Html Table and send to controller
i have two model classes Money and MoneyType.
a money object containe a List of TypeMoney property
In my money strongly typed view, that's the main index view there's html table for the list of type ...
0
votes
1
answer
317
views
BeginCollectionItem not binding
I've previously used the Html.BeginCollectionItem() extension and had no issues with binding from view to controller. In my current project however I'm having issues.
The model
public class ...
0
votes
1
answer
62
views
Custom editor template not rendered / fired
I'm using custom templates within my MVC project to display various object types in different ways. Some are working and others are not! For any that don't work, they are being passed into my object....
1
vote
0
answers
441
views
asp.net core editor template: Property name null
I have several editor templates in which appears the same code for rendering an Enum like in this example:
@model OriginDto
@* This div is what I want to move to a specific editor template *@
<...
0
votes
1
answer
312
views
Custom Boolean editor template in ASP.NET
I have a requirement to create an editor template in ASP.NET for model of type Boolean. The template should consist of one button that will display either '=' or '!=' as it's value. E.g.,
Boolean ...
0
votes
1
answer
2k
views
Id with RadioButtonFor
I'm trying to deal with radiobutton ids in asp MVC 5
I'm working like this
Example model
class A
{
public bool? radio { get; set; }
}
and in razor view
@Html.RadioButtonFor(x => x.NeutroBT, ...
0
votes
0
answers
48
views
EditorTemplates model bind null value in Post actions
Here am trying to use EditorTemplates for displaying list entity.
Below i mention code structure. PostResume is parent model.
public class PostResume
{
.....
[UIHint("ResumeURL")]
public ...
0
votes
0
answers
289
views
Nested view model - modifying generated name of input fields with EditorFor HTML-helper
Recently by stumbling across some CQRS I like to seperate the concept of a view model from the concept of a request (command), where the command is what is posted to the server. For example there's no ...
1
vote
0
answers
46
views
How can I DRY up code in my MVC Editor Templates?
Over time I have created a bunch of handy custom attributes for my editor templates.
But accessing their values in each template has started to clog them with a load of repeated code.
I am ...
1
vote
1
answer
374
views
Bootstrap 3 DateTimePicker in EditorTemplate
Created an Editor Template to dynamically create time slots. Now I am unable to select the time with datetimepicker. Code below. The following code works when apart of the main view. Is it possible to ...
0
votes
0
answers
527
views
TinyMCE not rendering in proper element/section of page on Ajax call to populate
I'm using TinyMCE as my HTML editor in a MVC project. On page load, everything seems to be fine (page can load multiple instances of TinyMCE), however, if I add another TinyMCE instance to the DOM ...
0
votes
0
answers
202
views
How to override RazorViewEngine when searching for EditorTemplate?
It seems like that the default RazorViewEngine in the asp.net mvc 5 framework, only look for EditorTemplate in a folder named EditorTemplate inside the Shared folder. I am okay with that convention, ...
0
votes
0
answers
169
views
Html.EditorForModel() is returning blank screen as razor is not recognizing the `Object.cshtml` template
I am trying to utilize the Html.EditorForModel() to clean up my models.
I created different EditorTemplate for different data types. and when I user @EditorFor() everything seems to be good.
Now, ...
1
vote
1
answer
192
views
Mvc EditorTemplate vs HtmlHelper for Adding Data Attributes
So I've searched around and haven't found any "new" answers. I'm not sure if it's because the answers are still correct, or no one has recently asked it.
I have the following classes (condensed for ...
1
vote
0
answers
472
views
Using Kendo Mvc Grid as Mvc EditorTemplate
I'm trying to use the Kendo Mvc Grid as a Mvc EditorTemplate like so.
ViewModel.cs
public class ViewModel{
...
public List<EditorViewModel> Lines{get;set;}
...
}
EditorViewModel.cs
...
1
vote
0
answers
2k
views
Can't set Html.HiddenFor value attribute
I'm trying to make a custom create form using an Editor Template and Entity Framework. The problem I'm having is that all of my fields show up with no value attribute set. This throws an error in ...
0
votes
1
answer
372
views
Model Binding on Save isn't returning full List of Nested Objects, maximum of one
Model Binding on Save isn't returning full List of Nested Objects, maximum of one
Trying to understand EditorTemplates, here is a simple example that isn't working at the moment. The Model isn't ...
0
votes
1
answer
112
views
Html Editor Template
I have a editor template DisplayConfig. In DisplayConfig
@model string
<input id="@(Model)_DisplayOrder" class="DisplayTypeConfigurator" type="number" />
<input id="@(Model)" class="...
1
vote
1
answer
178
views
How can i use MVC Editor Templates using AngularJS in a view
I have used MVC and jquery to create different Question types in a view using MVC Editor templates in one of the project. See code example
@Html.EditorFor(model => (model).UserIfno.Questions[0], "...
1
vote
1
answer
2k
views
Create Custom Editor in ASP.NET Core
I am in need of some advice. I am wanting to implement my own custom editor for a specific object type, Address. I started by reading the documentation for Tag Helpers on the .NET Core website and ...
0
votes
1
answer
47
views
complex type model wont pass list propery
hi guys i am having trouble with my mvc app. its a simple quiz app and i am stuck at creating create view for question model.
I have Question and Option model with appropriate view models(in my case ...
1
vote
0
answers
912
views
requiredif on an element in a list of custom inputs
I have a modelview that contains a list of ICustomInput values
public class DemoViewModel {
[Required]
public string FirstName {get; set;}
[Required]
public string LastName {get; set;}...
0
votes
4
answers
3k
views
MVC Collection Missing items on Post [duplicate]
I've recently run into some behaviour with MVC4 that I'm hoping to gain some perspective on. The behaviour in my actual project uses more complex objects, but I was able to replicate it with simple ...
0
votes
1
answer
620
views
C# Get nameof a property with the model extension
EDIT
I just noticed that when I tried to store the value of nameof(Model) it came in as "Model" but when I generated the TextBox the name field comes in as DateVerified.Model from this template. I'm ...
0
votes
1
answer
138
views
MVC - Model validation does not fire when using EditorTemplate with EditorForModel
I'm using EditorTemplate for Html.EditorForModel()
When used without EditorTemplate, validation works.
Without EditorTemplate - validation does not work.
This is my Form:
<div style="padding-top: ...
0
votes
0
answers
396
views
Create Checkbox List using EditorTemplate?
I am trying to create filters like in eCommerce website like Amazon, Flipkart.
I have created primary tables for all filters as below.
create table Work
(
id int identity(1,1) Primary Key Not Null,
...
1
vote
1
answer
3k
views
@Html display for and hidden for giving different values
So in my editor template I have the following:
<tr>
<td style="padding-right: 10px;">
@Html.CheckBoxFor(model => Model.IsSelected, new { @class = "CntIsSelected", @checked =...
1
vote
1
answer
455
views
Create an ASP.NET MVC Html helper similar to DropDownListFor
In certain cases I want to display SelectList object not using DropDownListFor helper. Instead, I want to create a helper that iterates over the SelectListItems, and draw something different.
I have ...
2
votes
0
answers
137
views
Editor Templates in angularjs with WebAPI
Environment:
I am using WebAPI and angularjs for my project.
Problem:
I need to dynamically create html for my models. I am thinking same as like EditorTemplates in MVC. So i create one html and ...
0
votes
0
answers
140
views
Counter in EditorTemplates ASP.NET MVC
I would like to display an incremental value in editor template.
My Razor View-
@model List<Target>
<form>
@Html.EditorForModel()
<input type="submit">
</form>
...
1
vote
2
answers
142
views
EditorTemplate for DataType.Time won't be applied
I have a from where i want to have a editor for a start- and end-time.
So i created a EditorTemplate in path 'Views/Shared/EditorTemplates/Time.cshtml'.
@model string
@{
var htmlAttributes = ...