Asp.NET Repeater Control(喜欢聊天)

时间:2012-08-02 13:11:15

标签: c# asp.net repeater

我想像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();

0 个答案:

没有答案