lnkbutton is the ID of button which is in RadTreeview1 .
Code - Behind
protected
void
RadTreeView1_NodeExpand(
object
sender, RadTreeNodeEventArgs e)
{
string
getc =
"SELECT [User].Name, [User].ID, Comments.ID AS CID, Comments.Comment, Comments.ItemID, Comments.UID, [User].T28 FROM [User] INNER JOIN Comments ON [User].ID = Comments.UID WHERE (Comments.ItemID = 271)"
;
dt = dbClass.ReturnDT(getc);
if
(dt.Rows.Count > 0)
{
int
n = dt.Rows.Count;
for
(
int
m = 0; m < n; m++)
{
RadTreeNode onDemandNode =
new
RadTreeNode();
onDemandNode.ImageUrl = dt.Rows[m][
"T28"
].ToString();
onDemandNode.Text =
"<u><b><a href='Profile/profile.aspx?Id="
+dt.Rows[m][
"ID"
].ToString()+
"'>"
+dt.Rows[m][
"Name"
].ToString()+
"</a></b></u> "
+ dt.Rows[m][
"Comment"
].ToString();
onDemandNode.ExpandMode = TreeNodeExpandMode.ClientSide;
//Add the node as a child of the currently expanded node
RadTreeView1.Nodes.FindNodeByText(
"Comments"
).Nodes.Add(onDemandNode);
}
}
}
protected void lnkbutton_Click(object sender, EventArgs e)
{
RadTextBox tb= (RadTextBox)RadTreeView1.Nodes.FindNodeByValue("pcomment").FindControl("postcomment");
string insertcomment = " INSERT INTO Comments (ItemID, UID, Comment) VALUES (271, "+Session["UserId"]+", '"+tb.Text+"')";
dbClass.DataBase(insertcomment);
}
What I want is ,whenever the user clicks the button post that is the button with ID lnkbutton , the RadTreeView1 gets refreshed (without reloading the whole page again) , what should i do to achieve this ??