Exemplo n.º 1
0
        private void LoadComments()
        {
            var dc = new AuthenticationDemoEntities();

            gv_comments.DataSource = dc.Comments.ToList();
            gv_comments.DataBind();
        }
Exemplo n.º 2
0
        protected void Btn_Insert_Click(object sender, EventArgs e)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                var dc = new AuthenticationDemoEntities();
                dc.Comments.Add(new Comment
                {
                    Comment1 = txt_comment.Text
                });

                dc.SaveChanges();
                LoadComments();
            }
        }