Why isn't the EditorTemplate showing the data?

前端 未结 1 1249
谎友^
谎友^ 2021-01-17 01:14

I rewrote my page to use EditorTemplates. And they are very nice. However, when I postback only the first row posts back data. The other 4 rows come up as null. FormSection

1条回答
  •  隐瞒了意图╮
    2021-01-17 02:00

    So with Darin's help, I got my partial view converted to editortemplates. Which, in this case, is a Good Thing (TM). However, I was only able to get the first row of the collection posted back. After some googling around, I ran across this page (which is also referenced by various stackoverflow questions). After implementing this bit of code, nothing was posting back. Then I ran across this post on StackOverflow. And saw that I referenced the wrong name for the collection. I needed to reference the property as opposed to the model name. Now everything is working as it should.

    A big thanks to Darin for all the help directly and indirectly he has provided me (and others). Thanks!

    For anyone, having a bit of trouble getting Steve's code to work, please look at this page. It's an overall solution to getting custom htmlhelpers to work in general.

    0 讨论(0)
提交回复
热议问题