■ ControllerBase 클래스의 Content 메소드를 사용하는 방법을 보여준다.
▶ Controllers/TestController.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
using Microsoft.AspNetCore.Mvc; namespace TestProject.Controllers { /// <summary> /// 테스트 컨트롤러 /// </summary> public class TestController : Controller { //////////////////////////////////////////////////////////////////////////////////////////////////// Method ////////////////////////////////////////////////////////////////////////////////////////// Public #region 인덱스 페이지 처리하기 - Index() /// <summary> /// 인덱스 페이지 처리하기 /// </summary> /// <returns>액션 결과</returns> public IActionResult Index() { return View(); } #endregion #region 컨텐트 페이지 처리하기 - Content() /// <summary> /// 컨텐트 페이지 처리하기 /// </summary> /// <returns>액션 결과</returns> public IActionResult Content() { return Content("테스트 문자열 입니다."); } #endregion } } |