SMS送信ビューの追加

の下に新しいフォルダを作成する。 Views という Sms..内 Smsという名前のファイルを追加する。 index.cshtml そこには次のようなコードが含まれている:

@model SmsModel

@using (Html.BeginForm("sms", "sms", FormMethod.Post))
{
    <div class="form-vertical">
        <h4>
            Sms<h4>
                @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                <div class="form-group">
                    @Html.LabelFor(model => model.To)
                    <div>
                        @Html.EditorFor(model => model.To, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.To, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.From)
                    <div>
                        @Html.EditorFor(model => model.From, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.From, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.Text)
                    <div>
                        @Html.EditorFor(model => model.Text, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Text, "", new { @class = "text-danger" })
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <button type="submit">Send</button>
                    </div>
                </div>
    </div>
}
<h2>@ViewBag.MessageId<h2>
<h3>@ViewBag.Error</h3>

ASP.NET Core MVCでSMSを送信する方法

ユーザーにSMSメッセージを送信する機能を追加して、.NETアプリケーションを強化しましょう。このチュートリアルでは、Webアプリケーションに簡単なフォームを追加し、指定された番号にSMSメッセージを送信する方法を説明します。

手順
1
このチュートリアルの紹介
2
Prerequisites
3
SMSプロジェクトファイルの作成
4
Vonage Dotnet SDKの追加
5
SMS送信モデルの作成
6
SMS送信ビューの作成
7
スタートアップルートの設定
8
SMSコントローラーの追加
9
ASP.NETアプリの設定
10
.NETアプリの実行
11
次はどうする?