2010-05-10 2 views

답변

3

, 대린 제안으로, 내용 (문자열)을 반환; 당신이 자동으로 ContentResult로 포장하는 행동의 결과가 아닌 다른 뭔가를 반환하는 경우 등

[HttpPost] 
public ActionResult Index(FormCollection form) { 
    /* 
     return Json(json); 
     return View; 
     return PartialView; 
    */ 
} 

등 다른 가능성도 있습니다.

[HttpPost] 
public ContentResult Index(FormCollection form) { 
    /* 
     return Content(string); 
     return File(bytes, contentType); 
     return DateTime.Now; 
     return 2; 
    */ 
} 
6
[HttpPost] 
public ActionResult Index() 
{ 
    return Content("some string", "text/plain"); 
} 
3
public ActionResult Index() 
{ 
    // ... 
    return File(bytes, contentType); 
} 
+0

감사합니다. http://stackoverflow.com/questions/2800956/how-to-return-back-a-message-after-a-submit에서 거의 동일한 질문을 게시했습니다. 도와 주시겠습니까? – learning

+0

바, 내가 글을 쓰는 동안 게시했습니다. :) +1 – Flexo

관련 문제