Multiple buttons calling a single method
<p>I'm trying to persist CSS user preference to my database according to which of six buttons is selected by the user.
On order to do this, I am trying to assign an integer value to each button click event; whichever is clicked will pass the corresponding integer as a parameter to my data access object to update the database able.</p>

<p>My method reads such:</p>

<pre><code>    protected void SetCSS(object sender, EventArgs e)
    {
        Users setCss = new Users();
        if (IsPostBack)
        {
            if (sender.ToString() == "Blue")
            {
                setCss.StylePreference = 0;
            }
            else if (sender.ToString() == "Khaki")
            {
                setCss.StylePreference = 1;
            }
            else if (sender.ToString() == "Night")
            {
                setCss.StylePreference = 2;
            }
            else if (sender.ToString() == "Pink")
            {
                setCss.StylePreference = 3;
            }
            else if (sender.ToString() == "White")
            {
                setCss.StylePreference = 4;
            }
            else if (sender.ToString() == "Yellow")
            {
                setCss.StylePreference = 5;
            }

            setCss.UserLoginName = Session["eMail"].ToString(); // current user
            setCss.SetStylePreference(setCss.UserLoginName, setCss.StylePreference);
        }
</code></pre>

<p>In each button's click event:</p>

<pre><code>    protected void btnBlue_Click(object sender, EventArgs e)
    {
        SetCSS(btnBlue, null);
    }

    protected void btnKhaki_Click(object sender, EventArgs e)
    {
        SetCSS(btnKhaki, null);
    }
</code></pre>

<p>etc...</p>

<p>I put a watch on the sender object and, when the Pink button is selected, the value assigned to the sender reads
        {Text="Pink"}
However, as I step through the if statement in the SetCSS method, when I come to the 
        else if (sender.ToString() == "Pink")
the condition is not met and, rather than setting the style preference to 3 as it should, the program passes on to the end of the statement, finishing by always assigning a value of 0 to the property.</p>

<p>What am I doing wrong?
Would really appreciate help...</p>
