ASPxGridView PerformCallback() does full page postback

核能气质少年 提交于 2019-12-12 04:29:06

问题


I have a checkbox that when clicked, calls a javascript program that calls grid.PerformCallback(), where grid is the client instance name of my ASPxGridView gridview. This gridview also has a custom callback method which databinds the table. However when i click my checkbox, instead of only performing callback on the gridview, my page does a full postback, which posts the form. How do i make it so that it only updates the gridview?

 function toggle()
    {                         
        productGrid.PerformCallback();
    }//end toggleExch()

<dx:ASPxGridView ClientInstanceName="productGrid" Width="100%" ID="productGrid" runat="server"
                DataSourceID="ProductSQL" EnableCallBacks="true" OnCustomCallback="productGrid_OnCustomCallback">            
        </dx:ASPxGridView>

protected void productGrid_OnCustomCallback(object sender,
                        DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e)
{
    System.Diagnostics.Debug.WriteLine("in postback");
    productGrid.DataBind();
}//end productGrid_OnCustomCallback()

so basically the debug line is not printed and the page goes into full postback - how do i only postback and databind the grid? (i need to do more server side processing before databinding or directly binding from jquery is out of the question)


回答1:


found the answer - should use iscallback instead of ispostback




回答2:


Unfortunately, you did not post the aspx markup of the button. However, if this is the ASPxButton, make certain that its AutoPostback property is false ...



来源:https://stackoverflow.com/questions/6384613/aspxgridview-performcallback-does-full-page-postback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!