Rendering the field name in an EditorTemplate (rendered through EditorFor())

前端 未结 3 882
离开以前
离开以前 2020-12-13 14:53

I\'m currently building the Admin back-end for a website in ASP.NET MVC.

In an ASP.NET MVC application, I\'ve started using the \'EditorFor\' helper method like so:<

3条回答
  •  猫巷女王i
    2020-12-13 15:23

    In our case we had to use Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName with ExpressionHelper.GetExpressionText

    which in razor was used like this:

               // hiddenFor was caching the value of this html input, and the value alone, nothing else on the page!
                Expression> expression = (m => m.OrgApiLoginCredentials[i].OrgApiLoginId); 
            }
            
    

提交回复
热议问题