Admin.Posts.AddEntry.CbUseRawCheckedChanged C# (CSharp) Method

CbUseRawCheckedChanged() private method

Handles the CheckedChanged event of the cbUseRaw control.
private CbUseRawCheckedChanged ( object sender, EventArgs e ) : void
sender object The source of the event.
e EventArgs The instance containing the event data.
return void
        private void CbUseRawCheckedChanged(object sender, EventArgs e)
        {
            if (cbUseRaw.Checked)
            {
                txtRawContent.Text = txtContent.Text;
                var cookie = new HttpCookie(RawEditorCookie, "1") { Expires = DateTime.Now.AddYears(3) };
                Response.Cookies.Add(cookie);
            }
            else
            {
                txtContent.Text = txtRawContent.Text;
                if (Request.Cookies[RawEditorCookie] != null)
                {
                    var cookie = new HttpCookie(RawEditorCookie) { Expires = DateTime.Now.AddYears(-3) };
                    Response.Cookies.Add(cookie);
                }
            }

            txtRawContent.Visible = cbUseRaw.Checked;
            txtContent.Visible = !cbUseRaw.Checked;

            // Response.Redirect(Request.RawUrl);
        }