Need to call server side event using __doPostBack
asp.net, javascript, rad-controls
Solution
You'll want to look at using the ClientScriptManager.GetPostBackEventReference method. This will create the correct javascript call ("__doPostBack") for the control/action using the ClientScriptManager (untested example):
<script type="text/javascript">
function callPostBack() {
<%= Page.ClientScript.GetPostBackEventReference(RadTreeView1, String.Empty) %>;
}
</script>
Problem
I have server side event like this. ``` protected void RadTreeView1_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e) { // implementation here. } ``` I am trying to call it from client side javascript. I have tried __doPostBack("contextMenuItemID", "some string") it posts the page back to server, but this does not invoke the original ContextMenuItemClick event. How can I invoke the original contextMenuItemClick event with proper event Args?