为什么我得到System.Data.Linq.Binary的Html.Hidden错误?

时间:2012-06-26 13:28:32

标签: hidden-field

我想将隐藏的openid数据发布到一个动作中,在Razor中我使用以下代码:

@Html.Hidden("OpenID", Request.QueryString["openid"]);

然后我收到了这个错误:

Compiler Error Message: CS0012: The type 'System.Data.Linq.Binary' is defined in an     assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq,     Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Source Error:


Line 11: 
Line 12: <form method="post" action="Register">
Line 13:     @Html.Hidden("OpenID", Request["openid"]);

1 个答案:

答案 0 :(得分:0)

 <compilation debug="true">
  <assemblies>
   <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  </assemblies>
</compilation>