-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoginFormExampleController.cs
49 lines (44 loc) · 1.24 KB
/
LoginFormExampleController.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
41
42
43
44
45
46
47
48
49
using FeedbackMessages.Extensions;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApp.MVC.Models;
namespace WebApp.MVC.Controllers
{
/// <summary>
/// ログインフォームサンプル
/// </summary>
public class LoginFormExampleController : ExampleControllerBase
{
/// <summary>
/// Getリクエストを処理します。
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
return View();
}
/// <summary>
/// Postリクエストを処理します。<br/>
/// ログイン処理を実行します。
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public ActionResult Index(HomeModel model)
{
// アノテーションで入力チェックが実行されます。
if (!ModelState.IsValid)
{
return View();
}
this.InfoMessage($"UserId:{model.UserId}");
this.InfoMessage($"Password:{model.Password}");
return View(model);
}
}
}