发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
#region 系统辅助函数 -给控件注册事件
/// <summary>
/// 注册控件的一些客户端事件
/// </summary>
/// <param name="ctl">Button</param>
/// <param name="cliente">事件名称</param>
/// <param name="sScript">注册函数</param>
public void RegisterClient(Button ctl,ClientE cliente,string sScript)
{
//ClientScript.RegisterClientScriptBlock
ctl.Attributes.Add(cliente.ToString(), sScript);
}
/// <summary>
/// 给TextBox注册事件
/// </summary>
/// <param name="ctl"></param>
/// <param name="ClientE"></param>
/// <param name="sScript"></param>
public void RegisterClient(TextBox ctl, string ClientE, string sScript)
{
ctl.Attributes.Add(ClientE.ToString(), sScript);
}
/// <summary>
/// 给TextBox注册事件
/// </summary>
/// <param name="ctl"></param>
/// <param name="cliente"></param>
/// <param name="sScript"></param>
public void RegisterClient(TextBox ctl, ClientE cliente ,string sScript)
{
ctl.Attributes.Add(cliente.ToString(), sScript);
}
/// <summary>
/// 给CheckBox注册事件
/// </summary>
/// <param name="ctl"></param>
/// <param name="cliente"></param>
/// <param name="sScript"></param>
public void RegisterClient(CheckBox ctl, ClientE cliente, string sScript)
{
ctl.Attributes.Add(cliente.ToString(), sScript);
}
/// <summary>
/// 可以注册的事件
/// </summary>
public enum ClientE
{
/// <summary>
/// onClick事件
/// </summary>
onClick,
/// <summary>
/// onSubmit事件
/// </summary>
onSubmit,
/// <summary>
/// onfocus事件
/// </summary>
onFocus,
/// <summary>
/// 状态更改
/// </summary>
onChange,
/// <summary>
/// 失去焦点
/// </summary>
onBlur
}
#endregion
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。