Exemplo n.º 1
0
 //评论
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text == "" || TextBox2.Text == "")
     {
         Response.Write("<script>alert('标题/内容不能为空,请重新输入.');</script>");
     }
     else
     {
         if (CommentsManager.SetCommentByAid(TextBox1.Text, TextBox2.Text, Convert.ToInt32(Request.QueryString["aid"])))
         {
             string Now_User_Name = Now_User.now_user == ""?"游客":Now_User.now_user;
             Response.Write("<script>alert('您好," + Now_User_Name + ",您已评论成功!');window.location.href='Article_Page.aspx?aid=" + Request.QueryString["aid"].ToString() + "'</script>");
         }
         else
         {
             Response.Write("<script>alert('评论失败.');</script>");
         }
     }
 }