How can i stop the timer a an automatic WebAsyncRefreshPanel ?
i have set the RefreshInterval to 0 but it continue to refresh him self at the original interval!!!
any idea?
Hi,
You probably use async postback. Within async postback you may modify only content of WARP, but not its properties. To change any property of WARP (including RefreshInterval),- you need full postback.
Regards,ViktorInfragistics web team
Sorry, how I can rise a full postback from:
void WebAsyncRefreshPanel1_ContentRefresh(object sender, EventArgs e)
Thanks
Hi Merlinox,
You may use oEvent.fullPostBack=true. Please look at CSOM docs or at the description (bottom area in Properties of visual designer) for ClientSideEvents.RefreshRequest. However, if you trigger full postback, then server will not know who triggered that. Only common Page.OnLoad, etc. will be raised. So, if you want notify server about control who raised that postback, then you should create your own logic. For example, you may add a hidden/normal <input> and set a flag for your conditional postback. Below I used TextBox1 and Button2 located in WARP1. If you want to make TextBox1 it invisible, then you may set style="display:none" to it (or whatever you prefer). I used Button2 click to stop-autorefresh.
function WebAsyncRefreshPanel1_RefreshRequest(oPanel,oEvent,id){ if(id && id.indexOf('Button2') >= 0) { oEvent.fullPostBack = true; var text1 = oPanel.findControl('TextBox1'); if(text1) text1.value = 'warp1'; }}
protected void Page_Load(object sender, EventArgs e){ //System.Threading.Thread.Sleep(300); if(this.TextBox1.Text == "warp1") { this.WebAsyncRefreshPanel1.RefreshInterval = 0; this.TextBox1.Text = ""; }}