TextBox btnModify = (TextBox)item.FindControl("TextBoxL"); // this code is not workign
TextBox btnModify = (TextBox)FindControl("TextBoxL"); // i tried this one also but its to not working
protected void ListView1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox btnModify = (TextBox)items.FindControl("TextBoxL");
SqlConnection c = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString);
int myindex = ListView1.SelectedIndex;
string myId = ListView1.DataKeys[myindex][0].ToString();
//testing the value returned correctly
Response.Write(myId);
SqlCommand cmd = new SqlCommand("insert into rply(task_id,comment,rply_name,rpl_date)values('" + myId + "','" + btnModify.Text + "','" + s2 + "','" + DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") + "')", c);
c.Open();
cmd.ExecuteNonQuery();
c.Close();
}