1
我在返回視圖(viewModel)中看到一個錯誤,它說「'視圖'是一種類型,不能用作表達式。」我怎樣才能解決這個問題?無法將視圖模型傳遞給MVC中的視圖
Function ShowFeed() As ActionResult
Dim feedUrl = "somefeedurl"
Dim feed As SyndicationFeed = GetFeed(feedUrl)
' build a view model
Dim viewModel = New RssModel()
viewModel.Title = feed.Title.ToString
viewModel.Description = feed.Description.ToString
viewModel.Link = feed.Links.ToString
Return View(viewModel)
End Function
很好的答案。我沒有意識到。謝謝。 – user1477388 2012-08-14 13:37:24