In this tutorial we look at the ASP.NET framework and how we can build web applications using Visual Studio and C#. For our MVC tutorials the basic topics are covered and are listed below.
View the tutorial here at wftutorials.com.
- Introduction
- Hello World
- Routing
- Working with Views
- Working with layouts
- Connecting to a database
- Working with forms
Some samples are shown below of the tutorial content.
Simple Hello World
A simple route called HelloWorld in a controller called HomeController.cs
public IActionResult HelloWorld()
{
return View();
}
A simple view that goes with the route above.
@{
ViewData["Title"] = "HelloWorld";
}
<h2>HelloWorld</h2>
The output of this is shown below.

Working with Database
A route in a controller that connects to a database.
public IActionResult Users()
{
List<String> emails = new List<String>();
string connectionString = "server=localhost;user=root;password=;database=wftutorials";
MySqlConnection conn = new MySqlConnection(connectionString);
conn.Open();
var command = new MySqlCommand("SELECT email FROM musers limit 10;", conn);
var reader = command.ExecuteReader();
while (reader.Read())
{
var value = reader.GetValue(0).ToString();
emails.Add(value);
// do something with 'value'
}
return View(emails);
}
The View html template that goes with the route above.
@{
ViewData["Title"] = "Users";
}
@model List<String>;
<h2>Users</h2>
<ul>
@foreach (var item in @Model)
{
<li>@item</li>
}
</ul>
The output is shown below

View the full tutorial at wftutorials.com.