0
我試圖在我的asp.net mvc應用程序中使用流利的html和spark視圖引擎。 我已經assinged適當的基類,添加了程序集,當我做this.TextBox(「MyProperty」)它工作正常。 但是,當我嘗試使用this.TextBox(m => m.MyProperty)時,我得到以下異常。 任何想法可能導致這種情況?在Spark視圖中不能使用流暢的html lambda表達式
例外:
Dynamic view compilation failed.
c:\Users\Midas\Documents\Visual Studio 2008 \Projects\ChurchMVC\ChurchMVC\Views\Poll\New.spark(6,31): error CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type
c:\Users\Midas\Documents\Visual Studio 2008 \Projects\ChurchMVC\ChurchMVC\Views\Poll\New.spark(7,28): error CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type
1 using MvcContrib.FluentHtml;
2 using System;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Web.Mvc;
6 using System.Web.Mvc.Html;
7 using Microsoft.Web.Mvc;
8 using MvcContrib.FluentHtml.Elements;
9
10 namespace ChurchMVC.Controllers
11 {
12
13 [global::Spark.SparkViewAttribute(
14 TargetNamespace="ChurchMVC.Controllers",
15 Templates = new string[] {
16 "Poll\\New.spark",
17 "Layouts\\Application.spark",
18 "Layouts\\TwoColumn.spark",
19 "Layouts\\Base.spark"
20 })]
21 public class View6dda34d85cf14f8d8946e77056f25819 : Spark.Web.Mvc.SparkView<ChurchMVC.Models.ViewModels.PollViewModel>
22 {
23
24 public override System.Guid GeneratedViewId
25 { get { return new System.Guid("6dda34d85cf14f8d8946e77056f25819"); } }
26
27 string BuildArticleBreadcumb(ChurchDAL.Section section)
28 #line 10 "C:\Users\Midas\Documents\Visual Studio 2008\Projects\ChurchMVC\ChurchMVC\Views\Shared\_global.spark"
29 {
30 #line hidden
31 using(OutputScope(new System.IO.StringWriter()))
32 {
33 #line default
34 #line 11 "C:\Users\Midas\Documents\Visual Studio 2008 \Projects\ChurchMVC\ChurchMVC\Views\Shared\_global.spark"
35 if (section == null)
36 #line default
問題是,當我在web.config中設置basepage類型時,我在代碼中添加了程序集。顯然,這是重寫/忽略我的web.config設置。我希望他們是添加劑,但顯然不是。 – midas06 2009-11-16 14:55:57