Hi @Mohammad Qasim ,
According to your needs, I wrote an example, you can refer to it.
Default.aspx
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public static string test(string querytype)
{
return "{test:\'test\'}";
}
}
Default.aspx.cs
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<div>
<asp:Button ID="Button1"
Text="Test"
OnClientClick="BindTreeview()"
runat="server" />
</div>
</asp:Content>
JS on Default.aspx.cs
Result
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
YihuiSun