I'm exploring templates for the first time in ASP.NET MVC (5.1) and I've got a few custom DisplayFor
and EditorFor
templates and I'm curious how to go about a template for a new object entirely. Essentially I'm looking for an EditorFor
template where I don't pass in a model.
Is there an easy way to go about this built in or do I have to mess around with extending the HtmlHelper? Granted, I could use a partial view to accomplish what I want, but I was hoping not to. I just want to say "Hey, EditorFor
, make me a blank form for this type".
可能是DisplayForModel()
, EditorForModel()
和LabelForModel()
帮助者可以为您提供帮助。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.