r.a.d.controls version | Any Telerik control |
.NET version | 2.0 |
Visual Studio version | 2003/2005 |
programming language | C# |
browser support | all browsers supported by r.a.d.controls |
Sometimes I need to know if a page is going through a normal postback or a callback. Although Rad controls have a property for this, IsCallback, I prefer a page property which does not get involved with any control directly.
Simply add the following property to your page base class:
public bool IsAjaxCallback
{
get
{
HttpContext ctx = HttpContext.Current;
return (
ctx != null &&
ctx .Request != null &&
(ctx.Request.QueryString["rcbID"] != null || ctx.Request.Form["ctrlid"] != null));
}
}