I would like to create a more complex EditorTemplateone to select a client from the list.
EditorTemplate
I know DropDownListFor, but I would like to show cards with client images and some data is not only in the usual list select.
DropDownListFor
select
What I would like to do:
create EditorTemplateto select a client, for example ... In any POCO class
public class X{ [Key] int Id {get;set;} [UIHint("CustomerSelector")] int Custumer_Id {get;set;} }
And the editor template " CustomerSelector" can request all clients and display them in a list with rich names.
CustomerSelector
What is the problem:
EditorTemplate MVC ?
, - . , . MVC, , .
, , , . , , , .
, , - . . , , , . , - :
@Html.Action("CustomerSelect", new { fieldName = "Customer_Id" })
, , , , . , , - "MyCollection[" + i.ToString() + "].Customer_Id". , . .
"MyCollection[" + i.ToString() + "].Customer_Id"
- HtmlHelper. , , , , , , Razor.
HtmlHelper
Source: https://habr.com/ru/post/1661193/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1661188/adding-framework-imports-to-csproj&usg=ALkJrhj0mC1cnBkpmIWWPd5Hc58Qvicg8wApply a function to each cell of the matrix in R - loopsAdd dependency on .net core csproj file - .netHow is a blob stored in an indexed view? - sql-serverFalcon framework - как хранить переменные в сеансе? - pythonHow to test state machines Qt SCXML - qtHow to use a document in Typescript angular - jqueryUsing jQuery plugins inside a Typescript file - jqueryОтметить существующую переменную как candiate для неявного метода - scalaEGit: почему "Локальная ветка как вверх по течению не рекомендуется"? - gitAll Articles