Ajouter une vue d'envoi de SMS

Créer un nouveau dossier sous Views appelé Sms. A l'intérieur Smsajoutez un fichier appelé index.cshtml qui contient le code suivant :

@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>

Comment envoyer un SMS avec ASP.NET Core MVC

Améliorez votre application .NET en y ajoutant la possibilité d'envoyer des messages SMS aux utilisateurs. Ce tutoriel vous guide dans l'ajout d'un simple formulaire à votre application web et dans l'envoi d'un message SMS au numéro fourni.

Étapes
1
Introduction à ce tutoriel
2
Prerequisites
3
Créer le fichier du projet SMS
4
Ajouter Vonage Dotnet SDK
5
Créer un modèle d'envoi de SMS
6
Créer une vue d'envoi de SMS
7
Mise en place d'un itinéraire de démarrage
8
Ajouter un contrôleur SMS
9
Configurer l'application ASP.NET
10
Exécuter l'application .NET
11
Quelle est la prochaine étape ?