2009-06-08 11 views
0

私はそれがSqlExceptionがあるかどうかを知るかいけないが、私はあなたのソースコードが表示されます:のasp.net MVC +亜音速

//the update method 

public int Update(T item) { int result = 0; var query = BuildUpdateQuery(item); if (query != null) result = query.Execute(); return result; } 

///////////////////////////////////////////////////////////// 
public ActionResult Edit(Employee item) { if(ModelState.IsValid) { string resultMessage = ""; 
try 
{ _repository.Update(item); resultMessage = item.DescriptorValue() + " updated!"; } 

catch(Exception x) 
{ //edit this to return a message resultMessage = "ERROR: "+ item.DescriptorValue() + " failed: "+x.Message; } 
//if this is an Ajax request - just send back a message if (Request.IsAjaxRequest()) 
{ return Content(resultMessage); } 
else { return RedirectToAction("Index"); } } 
else { return View(); } } 
///////////////////////////////////////////////////////////////// 
+0

ソースコードを表示していただきありがとうございます。 – rball

答えて

0
  1. 何を知りたいのですか?

  2. これがAjaxリクエストかどうかを尋ねるif節をコメントアウトしました。次の行でそれがほしいと思うかもしれません...