2012-03-22 60 views
1

我在查看它時遇到此錯誤。以下方法或屬性之間的調用不明確

呼叫是下列方法或屬性之間曖昧: 'System.Web.Mvc.Controller.View(字符串)' 和 「System.Web.Mvc.Controller.View(System.Web.Mvc .IView)」

這裏是我的控制器

[HttpGet] 
public ActionResult Selling() { 
_table = new QuestionnaireSelling(); 
var model = _table.Get(UserID: _userId); 
return View(model); 
} 

這是我的模型類

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 

using Massive; 

namespace ChurchRealty.Models 
{ 
    public class QuestionnaireSelling : DynamicModel 
    { 
     public QuestionnaireSelling() : base("ChurchRealty", "QuestionnaireSelling", "ID") { } 

    } 
} 

這是我的看法 http://dl.dropbox.com/u/3037520/Selling.cshtml

我用海量的羅布科納

+0

我們展示控制器的動作代碼 – MikeSW 2012-03-22 07:42:25

+0

我使用大量 '[HTTPGET]'' 公衆的ActionResult銷售(){'' _table =新QuestionnaireSelling();'' VAR模型= _table.Get(用戶名:_userId);'' 返回查看(模型);'' }' – comfreakph 2012-03-22 07:54:42

+0

發表你的問題的代碼,請。在評論中發佈代碼時,準備工作並不容易。 – 2012-03-22 08:14:56

回答

1

沒有在這個問題給出太多信息。我有我的看法如下:

@model MyProject.ViewModels.MyViewModel 

只要確保當您返回到模型,這是同類型的,在這裏,你必須:

var model = _table.Get(UserID: _userId); 
return View(model); 

對我來說,這將是類似於:

MyViewModel viewModel = new MyViewModel 
{ 
    Users = _table.Get(UserID: _userId); 
}; 

return View(viewModel); 

如果您可以在您的問題中提供一些更詳細的代碼,那麼我可以更新我的答案。

相關問題