我想像Facebook选项那样创建一个“你在想什么”。但是,我无法在用户之前写过的标题下写评论。也许我应该使用2个中继器?我尝试了以下代码,但它没有解决我的问题:
TextBox txtCevap = e.Item.FindControl("txtCevap") as TextBox;
HiddenField hf = e.Item.FindControl("hfYorumID") as HiddenField;
int id = Convert.ToInt32(hf.Value);
object sessionToString = Session["KullaniciID"];
SqlCommand sqlSelect = new SqlCommand("sp_cevapEkle", conn);
sqlSelect.CommandType = System.Data.CommandType.StoredProcedure;
sqlSelect.Parameters.AddWithValue("YorumID", id);
sqlSelect.Parameters.AddWithValue("@KullaniciID", Convert.ToInt32(sessionToString));
sqlSelect.Parameters.AddWithValue("@Cevap", txtCevap.Text.ToString());
sqlSelect.Parameters.AddWithValue("@Tarih", DateTime.Now);
if (conn.State == System.Data.ConnectionState.Closed)
conn.Open();
sqlSelect.ExecuteNonQuery();
txtCevap.Text = "";
rptNeDusunuyorsun.DataBind();