有一个小小问题请大家帮忙! ListBox的AutoPostBack = true; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //假设你的DDL的id是BigClassList//确定DDL的selectIndexfor (int i=0;i<BigClassList.Items.Count; i++){if (BigClassList.Items[i].Text=="AAAAAA"))//判断如果某项的值是"AAA" // 如果是"AAA"就指定该项被选定BigClassList.SelectedIndex=i;//在这里指定DDL当前要选定的项} 忘了看,你的是LISTBOX但是LISTBOX和DropDownList类似吧通过SelectedIndex=值指定被选项 在ListBox的Load事件中加入判断,if(ListBox.Items[i].Select){ ListBox.Items.Insert(0,ListBox.Items[i]) ; ListBox.Items.Remove(ListBox.Items[i]);} private void ListBox1_SelectedIndexChanged(object sender, System.EventArgs e) { Session["BeforSelectIndex"] = ListBox1.selectIndex.tostring(); show(); } PageLode事件中加写 if (Session["BeforSelectIndex"] != null) ListBox1.SelectIndex = int(Session["BeforSelectIndex"].tostring()); 请问ASP.NET 如何实现 滑动相册 关于asp.net 自动生成google网站地图即 调用, GridView每新增一行dropdownlit的绑的值就不包含上面的值该怎么解决 UTF-8转 GBK问题 这段CSS或JS如何写? 100 分 C# 2005 ASP.NET 为什么我看不到自己写得类 在asp.net 如何实现同一个用户不能多处登陆? 关于DataAdapter的UPDATE问题 求高手解答! 招一个程序员 请高手指点江山 奇怪,asp.net页面好象不能有2个form ┏讨论,web中获取word问题┛
//确定DDL的selectIndex
for (int i=0;i<BigClassList.Items.Count; i++)
{
if (BigClassList.Items[i].Text=="AAAAAA"))//判断如果某项的值是"AAA"
// 如果是"AAA"就指定该项被选定
BigClassList.SelectedIndex=i;//在这里指定DDL当前要选定的项
}
但是LISTBOX和DropDownList类似吧
通过SelectedIndex=值指定被选项
if(ListBox.Items[i].Select)
{ ListBox.Items.Insert(0,ListBox.Items[i]) ;
ListBox.Items.Remove(ListBox.Items[i]);
}
{
Session["BeforSelectIndex"] = ListBox1.selectIndex.tostring();
show();
}
PageLode事件中加写
if (Session["BeforSelectIndex"] != null)
ListBox1.SelectIndex = int(Session["BeforSelectIndex"].tostring());