admin管理员组

文章数量:1415420

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?

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?

Share Improve this question asked May 7, 2012 at 13:48 Manas SahaManas Saha 1,4979 gold badges29 silver badges45 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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>

本文标签: javascriptNeed to call server side event using doPostBackStack Overflow