本文介绍了避免在主页面加载事件时菜单重新绑定(在内部!ISpostback)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
母版页加载
Master page load
if (!IsPostBack)
{
string sql1 = "sql query";
DataTable dt = obj.RunSqlReturnDT(sql1);
Accordion1.DataSource = dt.DefaultView;
Accordion1.DataBind();
}
Accordion1_ItemDataBound Event(Repeater bind inside accordion AS MENU)
protected void Accordion1_ItemDataBound(object sender, AjaxControlToolkit.AccordionItemEventArgs e)
{
if (e.ItemType == AjaxControlToolkit.AccordionItemType.Header)
{
string a = (e.AccordionItem.FindControl("Label4") as Label).Text;
ViewState["Categoryname"] = a;
}
if (e.ItemType == AjaxControlToolkit.AccordionItemType.Content)
{
string cat_name = ViewState["Categoryname"].ToString();
sql ="sql query";
Repeater Repeater1 = (Repeater)e.AccordionItem.FindControl("Repeater1");
DataTable dt = obj.RunSqlReturnDT(sql11);
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
}
我想再次停止重新绑定手风琴&再次...它重新绑定了整个..我的问题是我想找到最后一个点击选项并将其聚焦..
在此先感谢!!
i want to stop re-bind of accordion again & again ...its rebind the whole.. my problem is i want to find the last click option and focus it..
Thanks In Advance!!
推荐答案
这篇关于避免在主页面加载事件时菜单重新绑定(在内部!ISpostback)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!