|
#region Copyright
/*
Copyright (C) 2005 Argiris Kirtzidis
This script is supplied "as is" without any form of warranty. I shall not be liable for
any loss or damage to person or property as a result of using this script. Use this script
at your own risk! You are licensed to use this script free of charge for commercial or
non-commercial use providing you do not remove the copyright notice or disclaimer.
*/
#endregion
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace Ajax.Controls
{
/// <summary>
/// The base control for controls to get notified for callback events from the client.
/// </summary>
public class AjaxControl : System.Web.UI.WebControls.WebControl, ICallBackEventHandler
{
/// <summary>
/// Raised by the AjaxHttpModule.
/// </summary>
public event EventHandler CallBack;
/// <summary>
/// Implements the ICallBackEventHandler interface. It is called by the AjaxHttpModule.
/// </summary>
public void RaiseCallBackEvent()
{
OnCallBack(EventArgs.Empty);
}
public AjaxControl()
{
}
public AjaxControl(HtmlTextWriterTag tag) : base(tag)
{
}
protected override void OnPreRender(EventArgs e)
{
// Register 'CallBackObject.js' script
CallBackHelper.EnableAjaxOnPage();
base.OnPreRender (e);
}
protected virtual void OnCallBack(EventArgs e)
{
if (CallBack != null)
CallBack(this, e);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.