Hw cn insert commt,if txtbx btn r in datalist
protected void Button2_Click(object sender, EventArgs e)
{
string Id = ((Button)sender).CommandArgument;
com.User_Id = Convert.ToInt32(Session["Id"]);
com.Blog_Id = Convert.ToInt32(Id);
foreach (DataListItem dli in DataList1.Items)
{
TextBox text = (TextBox)dli.FindControl("CommentText");
com.Comment = text.Text;
}
cs.da.CommentTables.InsertOnSubmit(com);
cs.da.SubmitChanges();
Response.Redirect(Request.Url.AbsoluteUri);//prevent to reinsert data after refresh data
UpdatePanel1.Update();
}