-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditComment.aspx.cs
37 lines (36 loc) · 1.16 KB
/
EditComment.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class EditComment : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string emailid = Session["Email_ID"].ToString();
lblemailid.Text = emailid;
}
protected void Button1_Click(object sender, EventArgs e)
{
string commentcontent = txtcommentcontent.Text;
DateTime modifieddate = DateTime.Now;
int commentid = Convert.ToInt16(GridView1.SelectedValue);
CommentBLL cl = new CommentBLL();
int i = cl.UpdateComment(commentid,commentcontent,modifieddate);
if (i == 1)
{
Response.Write("<script language='javascript'>alert('Comment has been updated !');</script>");
GridView1.DataBind();
}
else
{
Response.Write("<script language='javascript'>alert('Comment is failed to be updated !');</script>");
GridView1.DataBind();
}
}
protected void Button2_Click(object sender, EventArgs e)
{
txtcommentcontent.Text = "";
}
}