Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc asp.net mvc视图为模型呈现不正确的属性值_Asp.net Mvc_Vb.net_Razor_Asp.net Mvc 5 - Fatal编程技术网

Asp.net mvc asp.net mvc视图为模型呈现不正确的属性值

Asp.net mvc asp.net mvc视图为模型呈现不正确的属性值,asp.net-mvc,vb.net,razor,asp.net-mvc-5,Asp.net Mvc,Vb.net,Razor,Asp.net Mvc 5,我有一个局部视图,无法为模型渲染正确的值。下面的两行都无法呈现正确的值。就好像视图不会刷新一样 @Html.HiddenFor(Function(model) model.customOptionID) <input type="text" id="customOptionID" value="@Model.customOptionID" /> 模型: Public Class customOption Public Property customOptionID As I

我有一个局部视图,无法为模型渲染正确的值。下面的两行都无法呈现正确的值。就好像视图不会刷新一样

@Html.HiddenFor(Function(model) model.customOptionID)
<input type="text" id="customOptionID" value="@Model.customOptionID" />
模型:

Public Class customOption

   Public Property customOptionID As Integer

   <Required>
   Public Property Title As String

   <Required>
   Public Property customType As String

   Public Property customItemChoiceID
   Public Overridable Property customItemChoice As customItemChoice
End Class
Public Class customItemChoice

    Public Property customItemChoiceID As Integer

    Public Property choices As String

    Public Property customOptionID As Integer
    <Required>
    Public Overridable Property customOption As customOption

End Class
公共类自定义选项
公共属性customOptionID为整数
公共财产所有权作为字符串
公共属性customType为字符串
公共属性customItemChoiceID
公共可重写属性customItemChoice作为customItemChoice
末级
公共类customItemChoice
公共属性customItemChoiceID为整数
作为字符串的公共属性选择
公共属性customOptionID为整数
公共可重写属性customOption作为customOption
末级

检查下面的链接以获取@Html.HiddenFor扩展方法

Public Class customOption

   Public Property customOptionID As Integer

   <Required>
   Public Property Title As String

   <Required>
   Public Property customType As String

   Public Property customItemChoiceID
   Public Overridable Property customItemChoice As customItemChoice
End Class
Public Class customItemChoice

    Public Property customItemChoiceID As Integer

    Public Property choices As String

    Public Property customOptionID As Integer
    <Required>
    Public Overridable Property customOption As customOption

End Class