User name not getting to database
<p>I am using the following to store the current user name in a variable that is passed to my stored procedure and then to my database.  This is initiated with a button click.</p>

<pre><code>string UserName = Page.User.Identity.Name.ToString();
</code></pre>

<p>The variable is sent with this command:</p>

<pre><code>cmd.Parameters.AddWithValue("@UserName", UserName);
</code></pre>

<p>I have created a web form in Web Developer 2008 Express, and when I display the browser in Web Developer I get the desired results.  When I run the web page from my native browser (Firefox) running on a Mac, I get nothing.  Web Developer is running on a Windows 2008 Server installation.  Do I need to do something different for Macs?  I will have a majority of users who will use Mac rather than Windows.</p>

<p>Here is the code from the aspx.cs</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;



namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void MasterData_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
        {

        }

        protected void btnUpdate_Click(object sender, EventArgs e)
        {

            using (SqlConnection con = new SqlConnection("server=(local);database=InvoiceSHC;Trusted_Connection=Yes"))
            {

                // Get the UserId of the logged in user 

                string UserName = HttpContext.Current.User.Identity.Name.ToString();
                string Timestamp = DateTime.Now.ToString();
                //Not sure why you need a SqlDataAdapter unused here.
                //SqlDataAdapter DA = new SqlDataAdapter("UpdateSHCInvoice", con);
                SqlCommand cmd = new SqlCommand("UpdateSHCInvoice", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@Ref", dlRef.SelectedItem.Value);
                cmd.Parameters.AddWithValue("@PhaseName", dlPhase.SelectedItem.Value);
                cmd.Parameters.AddWithValue("@PageType", dlPageType.SelectedItem.Value);
                cmd.Parameters.AddWithValue("@Page", tbPage.Text);
                cmd.Parameters.AddWithValue("@Percent", dlPercent.SelectedItem.Value);
                cmd.Parameters.AddWithValue("@ChngType", dlChngType.SelectedItem.Value);
                cmd.Parameters.AddWithValue("@UserName", UserName);
                cmd.Parameters.AddWithValue("@Timestamp",Timestamp);
                con.Open();
                cmd.ExecuteNonQuery();

                GridView1.DataBind();

            }



        }


    }
}
</code></pre>
