Finishing up—the ComposeTweet view

To finish up, we use the ComposeTweet view.

Open up the ComposeTweet view and add the following markup to the view:

@{ 
    ViewData["Title"] = "Tweet"; 
} 
 
<h2>Tweet</h2> 
 
<form method="post" asp-controller="Twitter" asp-action="PublishTweet"> 
 
    <div class="form-group"> 
        <label for="tweet">Tweet : </label> 
        <input type="text" class="form-control" name="tweetText"          id="tweetText" value="What's happening?" /> 
    </div> 
         
    <div class="form-group"> 
        <input type="submit" class="btn btn-success" /> 
    </div> 
</form> 

You will notice that once again, I am making use of Tag Helpers to define the controller and action to call. Only this time, I am doing it on the <form> tag. At this point, you are ready to run your application for the ...

Get C# 7 and .NET Core 2.0 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.