내가 뭘 잘못하고 있는지 알 수 없습니다. fileUpload 작업에 게시하는 인덱스보기로 프로젝트가 시작됩니다. fileUpload 액션에서 컨트롤러의 다른 메소드를 changeText()라고하고 changeText()의 끝에서 Results 문자열을 호출하여 매개 변수 문자열을 취합니다. Results()의 끝에서 Results.cshtml에 View()가 반환됩니다. 그러나 Results.cshtml은로드되지 않습니다. 내가 뭔가를 놓치고 있는지 궁금합니다..net의 별도 컨트롤러 동작에서 뷰로드하기
public ActionResult Index()
{
return View();
}
[HttpPost]
public void FileUpload(HttpPostedFileBase file)
{
Debug.WriteLine(file.FileName)
if (file != null)
{
var fileName = Path.GetFileName(file.FileName);
pathName = Path.Combine(Server.MapPath("~/Content/Images"), fileName);
file.SaveAs(pathName);
}
changeText(txt);
}
public void changeText (string text)
{
ResultX(textChange);
}
public ActionResult ResultX(string text)
{
Debug.WriteLine("resultx action");
return View(text);
}
Thanks.
주 컨트롤러를 호출하고 있는지 확인 작동하지 않는 경우. – OmG
사용중인 올바른 asp.net MVC 버전의 태그를 업데이트하십시오. – ps2goat