2011-08-16 18 views
1

私はDevexpressコントロールを使用するMVC3アプリケーションを持っています。厳密に型指定されたビューのエラー

私の最初のページは正常に動作しますが、これは強く入力されません。

私はエラー「BC30451: 『をViewDataを』が宣言されていないことは、その保護レベルにアクセスできないことがあります。」取得で始まる私の2ページ目:結果のVBコードはSystem.Web.Mvc.WebViewPageから継承

@ModelType IEnumerable(Of MyModel.XXX) 

    @Code 
     ViewBag.Title = "Index" 
    End Code 

    <h2>Index</h2> 

。 インポートに問題はありますか?

#ExternalChecksum("C:\Work\XXX\Views\FahrzeugMarke\Index.vbhtml","{406ea660-64cf-4c82-b6f0-42d48172a799}","A585D67D9E053939A220E5FDCF169863") 
'------------------------------------------------------------------------------ 
' <auto-generated> 
'  Dieser Code wurde von einem Tool generiert. 
'  Laufzeitversion:4.0.30319.235 
' 
'  Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 
'  der Code erneut generiert wird. 
' </auto-generated> 
'------------------------------------------------------------------------------ 

Option Strict Off 
Option Explicit On 

Imports DevExpress.Utils 
Imports DevExpress.Web.ASPxCallbackPanel 
Imports DevExpress.Web.ASPxClasses 
Imports DevExpress.Web.ASPxEditors 
Imports DevExpress.Web.ASPxGridView 
Imports DevExpress.Web.ASPxHtmlEditor 
Imports DevExpress.Web.ASPxMenu 
Imports DevExpress.Web.ASPxNavBar 
Imports DevExpress.Web.ASPxPopupControl 
Imports DevExpress.Web.ASPxRoundPanel 
Imports DevExpress.Web.ASPxSpellChecker 
Imports DevExpress.Web.ASPxSplitter 
Imports DevExpress.Web.ASPxTabControl 
Imports DevExpress.Web.ASPxTreeView 
Imports DevExpress.Web.ASPxUploadControl 
Imports DevExpress.Web.Mvc 
Imports DevExpress.Web.Mvc.UI 
Imports MvcMiniProfiler 
Imports System 
Imports System.Collections.Generic 
Imports System.IO 
Imports System.Linq 
Imports System.Net 
Imports System.Web 
Imports System.Web.Helpers 
Imports System.Web.Mvc 
Imports System.Web.Mvc.Ajax 
Imports System.Web.Mvc.Html 
Imports System.Web.Routing 
Imports System.Web.Security 
Imports System.Web.UI 
Imports System.Web.WebPages 

Namespace ASP 

    Public Class _Page_Views_FahrzeugMarke_Index_vbhtml 
     Inherits System.Web.Mvc.WebViewPage(Of IEnumerable(Of myModel.XXX)) 

     Public Sub New() 
      MyBase.New 
     End Sub 

     Protected ReadOnly Property ApplicationInstance() As ASP.global_asax 
      Get 
       Return CType(Context.ApplicationInstance,ASP.global_asax) 
      End Get 
     End Property 

     Public Overrides Sub Execute() 

WriteLiteral(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)) 


      #ExternalSource("C:\Work\XXX\Index.vbhtml",3) 

    ViewBag.Title = "Index" 
+0

PS:私はViewBag.Title =「インデックス」の行を削除した場合、私はそれは、システムで定義されているエラーは、「HTMLがあいまいです」を取得します。両方ともインポートされているWeb.WebPagesとSystem.Web.Mvc –

答えて

1

私はこの問題を解決すると思う:

私はMvcScaffoldingとビューを作成し、ファイルはANSIエンコーディングで保存されました。しかし、私のモデルのクラス名にはドイツのウムラウトがあり、これらは壊れていました。 UTF8へのファイルのエンコーディングを変更する

は、問題を解決し...

関連する問題