2009-05-23 160 views
2

一)目前,我對生活的asp.mvc測試部署的應用程序...但前幾天拒絕與以下錯誤的工作:從Beta升級asp.net MVC到Release 1.0

方法找不到:'System.String System.Web.Mvc.Html.LinkExtensions.RouteLink(System.Web.Mvc.HtmlHelper,System.String,System.Web.Routing.RouteValueDictionary,System.Web.Routing.RouteValueDictionary)'。

版本信息:Microsoft .NET Framework版本:2.0.50727.3053; ASP.NET版本:2.0.50727.3053

googed結果並沒有給我相關的事情:(

B)我的下一步是升級應用ASP.NET MVC 1.0 ...但在這裏我有一個新的問題:如果 在測試我有:

[AcceptVerbs(HttpVerbs.Post)] 
    public ActionResult Edit(FormCollection entityform) 
    { 
     var entity = repository.GetById(1); 

     UpdateModel(entity, entityform); 
     repository.Update(entity); 

     return View("Index", entity); 

    } 

那麼現在的UpdateModel(地圖, 「/接受IValueProvider或DefaultValueProvider /」);

問題:

  1. 什麼改變了這裏? (我想主機環境已經改變了一些東西)
  2. 我應該在這裏調整一下不打破已經實現的功能嗎?

回答

3
UpdateModel(entity, entityform.ToValueProvider()); 
1

一)當我升級我的web項目中,我注意到,什麼是包含在web.configs是不同的。注意有兩個web.configs,都在主項目目錄和Views中。我會建議創建一個新的MVC 1.0項目,並將web.configs與您的測試版進行比較。

b)我只是使用傳遞給實體的UpdateModel,如果你已經將FormCollection傳遞給了你的ActionResult,它會相應地更新它。

 
public ActionResult Edit(FormCollection entityform) 
{ 
    var entity = repository.GetById(1); 
    UpdateModel(entity);