jQuery Calling an ASMX Web Service that Returns Data
<p>I am using jsTree to organize pages created by users. Upon right-clicking and pressing "Rename" I want to fire a JS function that hits a function in my code behind without post back (if possible). I want it to grab whichever item's I'm on ID and rename it in the database and update the jsTree.</p>

<p>Here is a sample code-behind function:</p>

<pre><code>[System.Web.Services.WebMethod]
protected void RenamePage(object sender, EventArgs e)
{
    DataTable dt = new DataTable();
    using (SqlConnection con = new SqlConnection(Global.conString))
    {
        con.Open();
        using (SqlCommand cmd = new SqlCommand("contentPageUpdate", con))
        {
            cmd.Parameters.Add("@title", SqlDbType.VarChar).Value = Global.SafeSqlLiteral(txtPage.Text, 1);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.ExecuteNonQuery();
        }
        con.Close();

        //Update Content Page Repeater
        using (SqlCommand cmd = new SqlCommand("contentPageGetAll", con))
        {
            using (SqlDataAdapter da = new SqlDataAdapter(cmd))
            {
                da.Fill(dt);
            }
        }
    }
}
</code></pre>
