autompostback=“false” 就不会触发selectindexchanged 事件了
解决方案 »
- 用正则表达式如何去除string中的<!--[if gte vml 1]>...<![endif]-->片段
- 递归执行完后为什么不释放方法内申请的内存?
- 当我使用xlChart.CopyPicture,把东西放到内存后,我想知道我放到内存中的这个东西,是什么格式的?怎么通过C#做到这点呢?
- 谁能提供C#版的Ftp服务器的源码,谢谢?
- 如何解决类似错误 Could not load type 'xxxx.Global'.
- C#编写ASP.NET 中当textbox的textmode为password时,如何给它赋值?
- C#自建函数传递对象的问题?
- 你要么想找美女,你要么想了解它的.net 欢迎加入群组 [4411971]
- 难道就没人帮我吗?
- 高手拉我一吧,有關.Net製作SetUp
- 关于swf 临时文件夹
- 正则表达式
if (!Page.IsPostBack)
{
....
}我觉得是这个问题。
if (!Page.IsPostBack)
{
....
}
updatepanel无刷新
http://topic.csdn.net/u/20090709/12/9eefeb53-c4a6-4fd0-8c1b-1d3282627417.html
1 我这个页面没用Updatepanel,其中modalPE是一个ModalPopupExtender,加载好数据后,把一个panle弹出来,这三个下拉列表都在panle里
2 我就是想在选项变化后,回发后执行SelectedIndexChanged事件,加载下一级的下拉列表,两个有SelectedIndexChanged事件的下拉列表的 AutomPostBack都为true
下面是相关代码:
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)//Category 下拉列表变化---1级下拉列表
{
bindSubCategoryDropDowsList();
bindRCDropDowsList();
modalPE.Show();
} public void bindSubCategoryDropDowsList()
{
SubCategory_DropList.DataTextField = "SubCategory";
sqlcon = new SqlConnection(strCon); //select SubCategory from [STARCAT].[dbo].[SubCategory] where Category = (select ID FROM [STARCAT].[dbo].[Category] where Category='Infrastructure')
sqlcon.Open();
string str = "select SubCategory from [STARCAT].[dbo].[SubCategory] where Category = (select ID FROM [STARCAT].[dbo].[Category] where Category='" + Category_DropList.Text + "')";
SqlDataAdapter da = new SqlDataAdapter(str, sqlcon);
DataSet ds = new DataSet();
da.Fill(ds);
SubCategory_DropList.DataSource = ds;
SubCategory_DropList.DataBind();
sqlcon.Close();
} protected void SubCategory_DropList_SelectedIndexChanged(object sender, EventArgs e)//Sub Category ---2级下拉列表
{
bindRCDropDowsList();
modalPE.Show();
} public void bindRCDropDowsList()
{
//select RootCause from STARCAT.dbo.ClassifiedRootCause where SubCategory = (select ID from STARCAT.dbo.SubCategory where SubCategory='Infra only')
RootCause_DropList.DataTextField = "RootCause";
sqlcon = new SqlConnection(strCon);
sqlcon.Open();
string str = "select RootCause from STARCAT.dbo.ClassifiedRootCause where SubCategory = (select ID from STARCAT.dbo.SubCategory where SubCategory='" + SubCategory_DropList.Text + "')";
SqlDataAdapter da = new SqlDataAdapter(str, sqlcon);
DataSet ds = new DataSet();
da.Fill(ds);
RootCause_DropList.DataSource = ds;
RootCause_DropList.DataBind();
sqlcon.Close();
}