Can't get the model in de view mode MVC
<p>I'm new with C# MVC ASP.NET. I can't figure out why i get this exception. Can someone help me with this?</p>

<p>Exception after trying login: </p>

<p>An exception of type 'System.NullReferenceException' occurred in App_Web_stjzfqjl.dll but was not handled in user code</p>

<p>Controller code:</p>

<pre><code>public class LoginController : DatabaseController
{
    // GET: Login
    public ActionResult Login(string email, string wachtwoord)
    {
        int verificatie = 0;

        try
        {

            Session.RemoveAll();

            connection.Open();

            string selectQuery = "SELECT wachtwoord, is_beheerder, is_manager, gebruiker_id, voornaam, achternaam from gebruiker where email = @emailadres";
            MySqlCommand cmd = new MySqlCommand(selectQuery, connection);
            MySqlParameter emailParam = new MySqlParameter("@emailadres", MySqlDbType.VarChar);
            cmd.Parameters.Add(emailParam);
            emailParam.Value = email;

            MySqlDataReader dataReader = cmd.ExecuteReader();

            while (dataReader.Read())
            {

                   var gebruiker = new Gebruiker
                 { voornaam = dataReader.GetString("voornaam"),
                     achternaam = dataReader.GetString("achternaam"),
                     is_beheerder = dataReader.GetInt32("is_beheerder"),
                     wachtwoord = dataReader.GetString("wachtwoord"),
                     is_manager = dataReader.GetInt32("is_manager")
                   };


                if (gebruiker.wachtwoord == wachtwoord)
                {
                    verificatie = 1;

                }
                if(gebruiker.is_beheerder == 1)
                {

                    Session["Beheerder"] = gebruiker;


                }
                else
                {

                    Session["Gebruiker"] = gebruiker;


                }

            }
        }
        catch (Exception e)
        {
            ViewBag.error = email + e;
            return View();
        }
        finally
        {
            connection.Close();
        }

        if (verificatie == 1)
        {
            ViewBag.error = "Verificatie is GOED";
            Response.Redirect("~/Home/Index");
        }
        else
        {
            ViewBag.error= email + " " + wachtwoord;
        }
    return View(gebruiker);
}
</code></pre>

<p>In the layout view:</p>

<pre><code>@model DeGeenery.Models.Gebruiker

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="utf-8" /&gt;
&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
&lt;title&gt;@ViewBag.Title - The Greenery&lt;/title&gt;
&lt;link rel="shortcut icon" href="~/Content/images/favicon.png"&gt;
&lt;link href="~/Content/Sitev2.css" rel="stylesheet" type="text/css" /&gt;
&lt;script src="~/Scripts/modernizr-2.6.2.js"&gt;&lt;/script&gt;
&lt;script src="~/Scripts/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
&lt;script src="~/Scripts/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="wrapper"&gt;
    &lt;div class="header"&gt;
    &lt;div id="logo"&gt;&lt;a href="index.html"&gt;&lt;img src="~/Content/logo.png" /&gt;          &lt;/a&gt;&lt;/div&gt;
        &lt;div id="basket"&gt;&lt;a href=@Url.Action("Index", "Winkelwagen")&gt;&lt;img   src="~/Content/basket.png" /&gt;&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="navbar"&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;a href=@Url.Action("Index", "Home")&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=@Url.Action("Index", "Webshop")&gt;Webshop&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=@Url.Action("Index", "OverOns")&gt;Over ons&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=@Url.Action("Index", "Contact")&gt;Contact&lt;/a&gt;&lt;/li&gt;
            @if (Session["Gebruiker"] == null &amp;&amp; Session["Beheerder"] == null)
            {
                &lt;li style="float:right;"&gt;&lt;a href=@Url.Action("Login","Login")&gt;Login&lt;/a&gt;&lt;/li&gt;
            }
            @if (Session["Beheerder"] != null)
            {
                &lt;li style="float:right;"&gt;&lt;a href=@Url.Action("Loguit", "Login")&gt;Log uit&lt;/a&gt;&lt;/li&gt;
                &lt;li style="float:right;"&gt;&lt;a href=@Url.Action("Index", "Beheer")&gt;Beheer&lt;/a&gt;&lt;/li&gt;
                &lt;li style="float:right; color: white; margin-right: 10px;"&gt;&lt;h4&gt;&lt;a href=""&gt;Welkom, @Model.voornaam &lt;/a&gt;&lt;/h4&gt;&lt;/li&gt;
            }
            else if (Session["Gebruiker"] != null)
            {
                &lt;li style="float:right;"&gt;&lt;a href=@Url.Action("Loguit","Login")&gt;Log uit&lt;/a&gt;&lt;/li&gt;
                &lt;li style="float:right;"&gt;Welkom, @ViewBag.voornaam          ViewBag.achternaam&lt;/li&gt;
            }
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div class="body"&gt;
        @RenderBody()
    &lt;/div&gt;
    &lt;div class="footer"&gt;
        Copyright De Greenery &amp;copy; 2016
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>
</p>