ASPXGridView PerformCallback()执行完整的页面回发 [英] ASPxGridView PerformCallback() does full page postback

查看:2013
本文介绍了ASPXGridView PerformCallback()执行完整的页面回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复选框,当点击时,调用一个调用grid.PerformCallback()的JavaScript程序,其中grid是我的ASPxGridView gridview的客户端实例名称。此gridview还具有数据绑定表的自定义回调方法。但是,当我单击我的复选框,而不是只在gridview执行回调,我的页面做一个完整的回发,其中发布表单。如何才能更新gridview?

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

< dx:ASPxGridView ClientInstanceName =productGridWidth =100%ID =productGridrunat =server
DataSourceID =ProductSQLEnableCallBacks =trueOnCustomCallback =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()

所以基本上没有打印调试行页面进入完整的回发 - 我如何只回发和数据绑定网格? (我需要在数据绑定之前做更多的服务器端处理或直接从jquery绑定是不成问题的)

解决方案

找到答案 - 应该使用iscallback而不是ispostback


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)

解决方案

found the answer - should use iscallback instead of ispostback

这篇关于ASPXGridView PerformCallback()执行完整的页面回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆