C#: overwriting string value in if else statemnt?
<p>I have a fairly simple if else statement in C# that looks something like this;</p>

<pre><code>    string BodyContent = "";
    if (Request.Form["value1"] != "")
    {
        BodyContent = "bla bla 1";

    }

    else if (Request.Form["value2"] != "")
    {
        BodyContent = "bla bla 2";
    }
else if (Request.Form["value3"] != "")
{
    BodyContent = "bla bla 3";
}
else {
    BodyContent = "Error";
}
</code></pre>

<p>My problem is that even if Request.Form["value3"] does have a value it is the value from BodyContent in the value1 check that is visible. (It can only be one of the request form objects that has a value at any point in time, so it is not because both value1 and value3 has a request.form value)</p>

<p>What am i doing wrong?</p>
