最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
全编辑WebGrid控件LrcGrid(6)――控件呈现
时间:2022-06-30 10:39:36 编辑:袖梨 来源:一聚教程网
全编辑WebGrid控件LrcGrid(6)――控件呈现
创建子控件
重写CreateChildControls()过程,调用创建子控件的方法ReBuild()
每当 ASP.NET 页框架需要创建控件树时就会调用CreateChildControls()方法,且该方法调用并不限于控件生命周期的特定阶段。例如,可以在加载页时、在绑定数据过程中或者在呈现过程中调用CreateChildControls
protected override void CreateChildControls()
{
this.ReBuild();
}
重写OnPreRender(EventArgs e)过程,注册客户端脚本块,此脚本可使用户回车时进行焦点跳转,注释掉的部分为使用资源文件的方法.
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender (e);
if(this._isTabChg)
{
if(!Page.IsClientScriptBlockRegistered("lrc_chgTab"))
{
string str_chgTab = @"";
Page.RegisterClientScriptBlock("lrc_chgTab",str_chgTab);
}
}
/*
*
ResourceManager manager = new ResourceManager(this.GetType());
ResourceSet resources = manager.GetResourceSet(System.Globalization.CultureInfo.CurrentCulture,true,true);
if(!Page.IsClientScriptBlockRegistered("LiuRuiCai.LrcGrid.Script"))
{
string script = resources.GetString("ClientScript");
this.Page.RegisterClientScriptBlock("LiuRuiCai.LrcGrid.Script",script);
string style = resources.GetString("ClientStyle");
this.Page.RegisterClientScriptBlock("LiuRuiCai.LrcGrid.Style",style);
}
*/
}
ReBuild()方法,当在运行时改变了控件属性,可调用此方法重新构造控件,它调用一系列的内部过程:管理视图状态,清空子控件,重新初始化数据集,创建标题行、创建数据行、创建操作行等:
创建子控件
重写CreateChildControls()过程,调用创建子控件的方法ReBuild()
每当 ASP.NET 页框架需要创建控件树时就会调用CreateChildControls()方法,且该方法调用并不限于控件生命周期的特定阶段。例如,可以在加载页时、在绑定数据过程中或者在呈现过程中调用CreateChildControls
protected override void CreateChildControls()
{
this.ReBuild();
}
重写OnPreRender(EventArgs e)过程,注册客户端脚本块,此脚本可使用户回车时进行焦点跳转,注释掉的部分为使用资源文件的方法.
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender (e);
if(this._isTabChg)
{
if(!Page.IsClientScriptBlockRegistered("lrc_chgTab"))
{
string str_chgTab = @"";
Page.RegisterClientScriptBlock("lrc_chgTab",str_chgTab);
}
}
/*
*
ResourceManager manager = new ResourceManager(this.GetType());
ResourceSet resources = manager.GetResourceSet(System.Globalization.CultureInfo.CurrentCulture,true,true);
if(!Page.IsClientScriptBlockRegistered("LiuRuiCai.LrcGrid.Script"))
{
string script = resources.GetString("ClientScript");
this.Page.RegisterClientScriptBlock("LiuRuiCai.LrcGrid.Script",script);
string style = resources.GetString("ClientStyle");
this.Page.RegisterClientScriptBlock("LiuRuiCai.LrcGrid.Style",style);
}
*/
}
ReBuild()方法,当在运行时改变了控件属性,可调用此方法重新构造控件,它调用一系列的内部过程:管理视图状态,清空子控件,重新初始化数据集,创建标题行、创建数据行、创建操作行等:
相关文章
- 易企秀网页版登录-易企秀企业版登录入口 02-24
- qq浏览器网页版直达-QQ浏览器官网网页版直达 02-24
- 学习通网页版一键登录-学校通官方免费在线入口 02-24
- 女神漫画页面免费漫画在哪看-女神漫画全集在线观看 02-24
- 糖心少女vlog免费在线看-糖心Vlog2026最新地址发布 02-24
- 夸克官网入口-最新网页版地址直达 02-24