ActivEarth.SiteMaster.PostMessage C# (CSharp) Method

PostMessage() protected method

Method called when the Post Button is clicked. Adds a Message to the User's Recent Activity using the text in txbTitle and txbMessage and including a time stamp.
protected PostMessage ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        protected void PostMessage(object sender, EventArgs e)
        {
            if (txbTitle.Text != "" && txbMessage.Text != "")
            {
                User user = (User)Session["userDetails"];

                string[] dateTime = DateTime.Now.ToString("MM/dd/yyyy h:mmtt").Split(' ');
                user.Post(new Message(txbTitle.Text, txbMessage.Text, user, dateTime[0], dateTime[1]));

                if (UserDAO.UpdateUserProfile(user))
                {
                    Session["userDetails"] = user;
                }

                Response.Redirect(Request.RawUrl);
            }
        }