2014-01-10 75 views
5

我在我的mvc asp.net項目中使用DevExpress控件。這裏是查看代碼:無法轉換對象類型「System.Web.Mvc.HtmlHelper` 1 [System.Object]」鍵入「System.Web.Mvc.HtmlHelper」

<div> 
    @Html.DevExpress().TextBox(settings => 
    { 
     settings.Name = "TextBox"; 
     settings.Width = 170; 
     settings.Properties.DisplayFormatString = "[ 00 - 00 - 00 ]"; 
     settings.Text = "123456"; 
    }).GetHtml() 
</div> 

這裏是錯誤消息:

Unable to cast the object type "System.Web.Mvc.HtmlHelper` 1 [System.Object]" to 
type "System.Web.Mvc.HtmlHelper" 

我不能明白的地方我的代碼失敗,因爲它是從DevExpress的演示示例代碼。

+1

檢查此鏈接http://stackoverflow.com/questions/12288625/devexpress-error-in-adding-reports-in-razor-mvc3 –

回答

5

Ty for link,Nitin Varpe。我加入這個部分我主要的web.config:

<runtime> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0" /> 
    </dependentAssembly> 
</assemblyBinding> 
</runtime> 
相關問題