Asp.net Dropdownlist选择的索引已更改 [英] Asp.net Dropdownlist selected index in changed

查看:77
本文介绍了Asp.net Dropdownlist选择的索引已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,


i正在编写以下代码。


if(Page.IsPostBack == false)

{

试试

{


BindSectionDropDownlist();

BindSubSectionDropDownlist();

BindSectionLineDropDownlist();

}


catch(例外情况)

{

Response.Write("< script language = Javascript> alert(''" +

ex.Message.ToString()+"'');< / script> ;");

}

}

}

// BindSectionDropDownList的定义

private void BindSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSectionRecForReports();

reportCategory_Dropdownlist.DataTextField =" Section Desc";

reportCategory_Dropdownlist.DataValueField =" sectionId";

reportCategory_Dropdownlist.DataSource = dv;

reportCategory_Dropdownli st.DataBind();

reportCategory_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select-- ");


//reportCategoty_DropDownList.SelectedIndex=-1;

}

private void BindSubSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSubSectionRecReports();

subSection_Dropdownlist.DataTextField =" SectionDesc";

subSection_Dropdownlist.DataValueField =" sectionId";

subSection_Dropdownlist.DataSource = dv;

subSection_Dropdownlist.DataBind( );

subSection_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - ")) ;


//reportCategoty_DropDownList.SelectedIndex=-1;

}

private void BindSectionLineDropDownlist()

{


DataView dv = new DataView();

dv = objSectionMaster.GetSectionLineR ecReports();

sectionLineDesc_DropDownList.DataTextField =" Sectio nLineDescription" ;;

sectionLineDesc_DropDownList.DataValueField =" SectionLineId";

sectionLineDesc_DropDownList.DataSource = dv;

sectionLineDesc_DropDownList.DataBind();


sectionLineDesc_DropDownList.Items.Insert(0,new

ListItem(" - 选择 - "," -1"));


//reportCategoty_DropDownList.SelectedIndex=-1;

}


private void search_Button_Click(object sender,System.EventArgs e)

{

selectQuery();

}


selectQuery();

{


//基于
sectionLineDesc_DropDownList选择

}


前两个下拉列表的选择索引没有改变但是

第三个被选中当我点击搜索时,第三个下拉列表的索引被更改

按钮。

任何帮助将不胜感激。

Dear all ,

i am writting following code.

if(Page.IsPostBack==false)
{
try
{

BindSectionDropDownlist();
BindSubSectionDropDownlist();
BindSectionLineDropDownlist();
}

catch(Exception ex)
{
Response.Write("<script language=Javascript>alert(''"+
ex.Message.ToString()+"'');</script>");
}
}
}
// Defination of BindSectionDropDownList
private void BindSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSectionRecForReports();
reportCategory_Dropdownlist.DataTextField="Section Desc";
reportCategory_Dropdownlist.DataValueField ="sectionId";
reportCategory_Dropdownlist.DataSource=dv;
reportCategory_Dropdownlist.DataBind();
reportCategory_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSubSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSubSectionRecReports();
subSection_Dropdownlist.DataTextField="SectionDesc ";
subSection_Dropdownlist.DataValueField ="sectionId";
subSection_Dropdownlist.DataSource=dv;
subSection_Dropdownlist.DataBind();
subSection_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSectionLineDropDownlist()
{

DataView dv = new DataView();
dv = objSectionMaster.GetSectionLineRecReports();
sectionLineDesc_DropDownList.DataTextField="Sectio nLineDescription";
sectionLineDesc_DropDownList.DataValueField ="SectionLineId";
sectionLineDesc_DropDownList.DataSource= dv;
sectionLineDesc_DropDownList.DataBind();

sectionLineDesc_DropDownList.Items.Insert(0,new
ListItem("--Select--","-1"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}

private void search_Button_Click(object sender, System.EventArgs e)
{
selectQuery();
}

selectQuery();
{

//Code for further processing of on the basis of
sectionLineDesc_DropDownList selection
}

selection index of first two dropdownlist is not changed but
the third selected index of third dropdownlist is changed
when i am click on search button.
any help will be greatly appreciated.

推荐答案

hi,

首先描述你想要做的事情会很有用。代码是

有用,但除非你描述你要做什么,否则它是没有用的

it!


你说前两个下拉列表的选定索引没有改变,他们应该改变吗?在回应用户?或者你的

代码?

你在每个绑定方法中都有这行代码:

//reportCategoty_DropDownList.SelectedIndex=-1;

它应该被取消注释吗?


很乐意提供帮助,如果你能提供更多信息

tim

Santosh < Sa *************** @ yahoo.com写了留言

新闻:11 *************** ****** @h48g2000cwc.googlegro ups.com ...

first it would be useful to describe what you are trying to do. code is
helpful but it''s no good unless you describe what you are trying to do with
it!

you say that the selected index of the first two dropdownlists are not
changed, are they supposed to change? in response to the user? or your
code?
you have this line of code in each bind method:
//reportCategoty_DropDownList.SelectedIndex=-1;
is it supposed to be uncommented?

happy to help if you can provide more info
tim
"Santosh" <Sa***************@yahoo.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...

亲爱的,


i正在撰写以下内容代码。


如果(Page.IsPostBack == false)

{

试试

{


BindSectionDropDownlist();

BindSubSectionDropDownlist();

BindSectionLineDropDownlist();

}


catch(exception ex)

{

Response.Write("< script language = Javascript> alert('' " +

ex.Message.ToString()+"'');< / script>");

}

}

}


// BindSectionDropDownList的定义


private void BindSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSectionRecForReports();

reportCategory_Dropdownlist.DataTextField ="部分描述" ;;

reportCategory_Dropdownlist.DataValueField =" sectionId";

reportCategory_Dropdownlist.DataSource = dv;

reportCategory_Dropdownlist.DataBind();

reportCategory_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - "));


//reportCategoty_DropDownList.SelectedIndex=-1;

}


private void BindSubSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSubSectionRecReports();

subSection_Dropdownlist.DataTextField =" SectionDesc " ;;

subSection_Dropdownlist.DataValueField =" sectionId" ;;

subSection_Dropdownlist.DataSource = dv;

subSection_Dropdownlist.DataBind();

subSection_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - "));


//reportCategoty_DropDownList.SelectedIndex= -1;

}


private void BindSectionLineDropDownlist()

{


DataView dv = new DataView();

dv = objSectionMaster.GetSectionLineRecReports();

sectionLineDesc_DropDownList.DataTextField =" Sectio nLineDescription";

sectionLineDesc_DropDownList.DataValueField =" SectionLineId";

sectionLineDesc_DropDownList.DataSource = dv;

sectionLineDesc_DropDownList.DataBind();


sectionLineDesc_DropDownList .Items.Insert(0,new

ListItem(" - Select - "," -1"));


// reportCategoty_DropDownList.SelectedIndex = -1;

}


private void search_Button_Click(object sender,System.EventArgs e)

{

selectQuery();

}


selectQuery();

{


//基于

sectionLineDesc_DropDownList选择进一步处理的代码


}


前两个下拉列表的选择索引没有改变但是

第三个下拉列表的第三个选择索引被更改

当我点击搜索按钮。


任何帮助将不胜感激。
Dear all ,

i am writting following code.

if(Page.IsPostBack==false)
{
try
{

BindSectionDropDownlist();
BindSubSectionDropDownlist();
BindSectionLineDropDownlist();
}

catch(Exception ex)
{
Response.Write("<script language=Javascript>alert(''"+
ex.Message.ToString()+"'');</script>");
}
}
}
// Defination of BindSectionDropDownList
private void BindSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSectionRecForReports();
reportCategory_Dropdownlist.DataTextField="Section Desc";
reportCategory_Dropdownlist.DataValueField ="sectionId";
reportCategory_Dropdownlist.DataSource=dv;
reportCategory_Dropdownlist.DataBind();
reportCategory_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSubSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSubSectionRecReports();
subSection_Dropdownlist.DataTextField="SectionDesc ";
subSection_Dropdownlist.DataValueField ="sectionId";
subSection_Dropdownlist.DataSource=dv;
subSection_Dropdownlist.DataBind();
subSection_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSectionLineDropDownlist()
{

DataView dv = new DataView();
dv = objSectionMaster.GetSectionLineRecReports();
sectionLineDesc_DropDownList.DataTextField="Sectio nLineDescription";
sectionLineDesc_DropDownList.DataValueField ="SectionLineId";
sectionLineDesc_DropDownList.DataSource= dv;
sectionLineDesc_DropDownList.DataBind();

sectionLineDesc_DropDownList.Items.Insert(0,new
ListItem("--Select--","-1"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}

private void search_Button_Click(object sender, System.EventArgs e)
{
selectQuery();
}

selectQuery();
{

//Code for further processing of on the basis of
sectionLineDesc_DropDownList selection
}

selection index of first two dropdownlist is not changed but
the third selected index of third dropdownlist is changed
when i am click on search button.
any help will be greatly appreciated.



描述当我从列表中选择第一项时,我有三个下拉列表

当我

从第二个下拉列表中选择第三个项目填充的项目

与第二个项目选择相关。并且在选择第三个

下拉列表项目文本时,我将显示结果。


eg.i我有第一个下拉列表它将包含所有国家/地区列表

当我选择一个国家时,它将显示与该

国家相关的所有州。如果我从列表中选择状态,它将显示与所选状态相关的所有区域

。在区域的选择上我会搜索另外的信息。


Tim_Mac写道:
The description is ,

i am having three dropdownlists when i am selected first item from list
it will display all related items in the next drop down list when i am
choose item from second drop down list in third all items filled
related to second item selection. and in the selection of third
dropdown list item text i will be display result.

eg.i am having first dropdownlist it will contains all country list
when i am choose one country it will display all states related to that
country. if i am selected state from list it will display all districts
related to the selected states. and on the selection of district i will
be search another information.

Tim_Mac wrote:

hi,

首先描述你想要做的事情会很有用。代码是

有用,但除非你描述你要做什么,否则它是没有用的

it!


你说前两个下拉列表的选定索引没有改变,他们应该改变吗?在回应用户?或者你的

代码?

你在每个绑定方法中都有这行代码:

//reportCategoty_DropDownList.SelectedIndex=-1;

它应该被取消注释吗?


很乐意提供帮助,如果你能提供更多信息

tim


Santosh < Sa *************** @ yahoo.com写了留言

新闻:11 *************** ****** @h48g2000cwc.googlegro ups.com ...

first it would be useful to describe what you are trying to do. code is
helpful but it''s no good unless you describe what you are trying to do with
it!

you say that the selected index of the first two dropdownlists are not
changed, are they supposed to change? in response to the user? or your
code?
you have this line of code in each bind method:
//reportCategoty_DropDownList.SelectedIndex=-1;
is it supposed to be uncommented?

happy to help if you can provide more info
tim
"Santosh" <Sa***************@yahoo.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...

亲爱的,


i正在撰写以下内容代码。


如果(Page.IsPostBack == false)

{

试试

{


BindSectionDropDownlist();

BindSubSectionDropDownlist();

BindSectionLineDropDownlist();

}


catch(exception ex)

{

Response.Write("< script language = Javascript> alert('' " +

ex.Message.ToString()+"'');< / script>");

}

}

}

// BindSectionDropDownList的定义

private void BindSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSectionRecForReports();

reportCategory_Dropdownlist.DataTextField =&quo t; Section Desc" ;;

reportCategory_Dropdownlist.DataValueField =" sectionId" ;;

reportCategory_Dropdownlist.DataSource = dv;

reportCategory_Dropdownlist.DataBind() ;

reportCategory_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - "));


//reportCategoty_DropDownList.SelectedIndex=-1;

}

private void BindSubSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSubSectionRecReports();

subSection_Dropdownlist.DataTextField =" SectionDesc" ;;

subSection_Dropdownlist.DataValueField =" sectionId";

subSection_Dropdownlist.DataSource = dv;

subSection_Dropdownlist.DataBind();

subSection_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - "));


// reportCategot y_DropDownList.SelectedIndex = -1;

}

private void BindSectionLineDropDownlist()

{


DataView dv = new DataView();

dv = objSectionMaster.GetSectionLineRecReports();

sectionLineDesc_DropDownList.DataTextField =" Sectio nLineDescription";

sectionLineDesc_DropDownList.DataValueField =" SectionLineId";

sectionLineDesc_DropDownList.DataSource = dv;

sectionLineDesc_DropDownList.DataBind();


sectionLineDesc_DropDownList .Items.Insert(0,new

ListItem(" - Select - "," -1"));


// reportCategoty_DropDownList.SelectedIndex = -1;

}


private void search_Button_Click(object sender,System.EventArgs e)

{

selectQuery();

}


selectQuery();

{


//基于

sectio进一步处理的代码nLineDesc_DropDownList选择

}


前两个下拉列表的选择索引未更改,但

第三个下拉列表的第三个选定索引已更改

当我点击搜索按钮时。

任何帮助将不胜感激。
Dear all ,

i am writting following code.

if(Page.IsPostBack==false)
{
try
{

BindSectionDropDownlist();
BindSubSectionDropDownlist();
BindSectionLineDropDownlist();
}

catch(Exception ex)
{
Response.Write("<script language=Javascript>alert(''"+
ex.Message.ToString()+"'');</script>");
}
}
}
// Defination of BindSectionDropDownList
private void BindSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSectionRecForReports();
reportCategory_Dropdownlist.DataTextField="Section Desc";
reportCategory_Dropdownlist.DataValueField ="sectionId";
reportCategory_Dropdownlist.DataSource=dv;
reportCategory_Dropdownlist.DataBind();
reportCategory_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSubSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSubSectionRecReports();
subSection_Dropdownlist.DataTextField="SectionDesc ";
subSection_Dropdownlist.DataValueField ="sectionId";
subSection_Dropdownlist.DataSource=dv;
subSection_Dropdownlist.DataBind();
subSection_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSectionLineDropDownlist()
{

DataView dv = new DataView();
dv = objSectionMaster.GetSectionLineRecReports();
sectionLineDesc_DropDownList.DataTextField="Sectio nLineDescription";
sectionLineDesc_DropDownList.DataValueField ="SectionLineId";
sectionLineDesc_DropDownList.DataSource= dv;
sectionLineDesc_DropDownList.DataBind();

sectionLineDesc_DropDownList.Items.Insert(0,new
ListItem("--Select--","-1"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}

private void search_Button_Click(object sender, System.EventArgs e)
{
selectQuery();
}

selectQuery();
{

//Code for further processing of on the basis of
sectionLineDesc_DropDownList selection
}

selection index of first two dropdownlist is not changed but
the third selected index of third dropdownlist is changed
when i am click on search button.
any help will be greatly appreciated.


通常通过AutoPostBack下拉列表完成。看起来很奇怪

你绑定了第一个Page_Load上的所有3个列表,因为你不知道是什么

来填充列表2和3,直到选择为止用清单1.


通常我会做这样的事情(伪代码):

First Page_Load(!PostBack)Bind List 1(清单2)并且3保持为空)

List1_SelectedIndex_Changed绑定列表2

List2_SelectedIndex_Changed绑定列表3

List3_SelectedIndex_Changed搜索任何内容


你在所有列表上都有AutoPostBack = true吗?另外,你还没有在SelectedIndexChanged事件中发布

。只用部分代码将你的

情况拼凑起来是非常困难的。如果您发布所有相关代码我将会很高兴再看一下。


tim

" Santosh" < Sa *************** @ yahoo.com写了留言

新闻:11 *************** ******:p79g2000cwp.googlegro ups.com ...
typically this is done via AutoPostBack dropdownlists. it seems strange
that you bind all 3 lists on the first Page_Load, since you can''t know what
to populate lists 2 and 3 with until a selection has been made with list 1.

normally i would do something like this (pseudo-code):
First Page_Load (!PostBack) Bind List 1 (lists 2 and 3 remain empty)
List1_SelectedIndex_Changed Bind List 2
List2_SelectedIndex_Changed Bind List 3
List3_SelectedIndex_Changed Search whatever

have you got AutoPostBack=true on all the lists? also, you haven''t posted
the SelectedIndexChanged events. it''s very difficult to piece together your
situation with only a part of the code. if you post all the relevant code i
will be happy to take a look again.

tim
"Santosh" <Sa***************@yahoo.comwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...

描述是,


i我有三个下拉列表,当我从列表中选择第一项时

它将在下一个下拉列表中显示所有相关项目当我是

从第二个下拉列表中选择第三项所有项目填写

与第二项选择相关。并且在选择第三个

下拉列表项目文本时,我将显示结果。


eg.i我有第一个下拉列表它将包含所有国家/地区列表

当我选择一个国家时,它将显示与该

国家相关的所有州。如果我从列表中选择状态,它将显示与所选状态相关的所有区域

。在区域的选择上我会搜索另外的信息。


Tim_Mac写道:
The description is ,

i am having three dropdownlists when i am selected first item from list
it will display all related items in the next drop down list when i am
choose item from second drop down list in third all items filled
related to second item selection. and in the selection of third
dropdown list item text i will be display result.

eg.i am having first dropdownlist it will contains all country list
when i am choose one country it will display all states related to that
country. if i am selected state from list it will display all districts
related to the selected states. and on the selection of district i will
be search another information.

Tim_Mac wrote:

> hi,
首先描述你想要做的事情会很有用。代码是有帮助的,但除非你用
描述你要做的事情,否则它是没有用的!

你说选择的索引前两个下拉列表没有改变,它们应该改变吗?在回应用户?或者你的
代码?
你在每个绑定方法中都有这行代码:
//reportCategoty_DropDownList.SelectedIndex=-1;
它应该被取消注释吗?
如果您能提供更多信息,请尽快提供帮助

" Santosh" < Sa *************** @ yahoo.com写了留言
新闻:11 ******************* **@h48g2000cwc.googlegr oups.com ...
>
first it would be useful to describe what you are trying to do. code is
helpful but it''s no good unless you describe what you are trying to do
with
it!

you say that the selected index of the first two dropdownlists are not
changed, are they supposed to change? in response to the user? or your
code?
you have this line of code in each bind method:
//reportCategoty_DropDownList.SelectedIndex=-1;
is it supposed to be uncommented?

happy to help if you can provide more info
tim
"Santosh" <Sa***************@yahoo.comwrote in message
news:11*********************@h48g2000cwc.googlegr oups.com...

亲爱的,


i正在编写代码。


if(Page.IsPostBack == false)

{

试试

{


BindSectionDropDownlist();

BindSubSectionDropDownlist();

BindSectionLineDropDownlist();

}


catch(例外情况)

{

Response.Write("< script language = Javascript> alert(''" +

ex.Message.ToString()+"'');< / script>");

}

}

}


// BindSectionDropDownList的定义


private void BindSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSectionRecForReports();

reportCategory_Dropdownlist.DataTextField =" Section Desc" ;

reportCategory_Dropdownlist.DataValueField =" sectionId";

reportCategory_Dropdownlist.DataSource = dv;

reportCategory_Dropdownlist.DataBind();

reportCategory_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - "));


//reportCategoty_DropDownList.SelectedIndex=-1;

}


private void BindSubSectionDropDownlist()

{

DataView dv = new DataView();

dv = objSectionMaster.GetSubSectionRecReports();

subSection_Dropdownlist.DataTextField =" SectionDesc" ;

subSection_Dropdownlist.DataValueField =" sectionId";

subSection_Dropdownlist.DataSource = dv;

subSection_Dropdownlist.DataBind();

subSection_Dropdownlist.Items.Insert(0,new

ListItem(" - Select - "," - Select - "));


//reportCategoty_DropDownList.SelectedIndex=-1;

}


private void BindSectionLineDropDownlist()

{


DataView dv = new DataView ();

dv = objSectionMaster.GetSectionLineRecReports();

sectionLineDesc_DropDownList.DataTextField =" Sectio nLineDescription" ;;

sectionLineDesc_DropDownList.DataValueField =" ; SectionLineId" ;;

sectionLineDesc_DropDownList.DataSource = dv;

sectionLineDesc_DropDownList.DataBind();


sectionLineDesc_DropDownList.Items.Insert( 0,new

ListItem(" - Select - "," -1"));


//reportCategoty_DropDownList.SelectedIndex=- 1;

}


private void search_Button_Click(object sender,System.EventArgs e)

{

selectQuery();

}


selectQuery();

{


//基于

sectionLineDesc_DropDownList选择进一步处理的代码


}


前两个下拉列表的选择索引没有改变但是

第三个下拉列表的第三个选择索引被更改
当我点击搜索时
按钮。


我们将非常感谢任何帮助。
Dear all ,

i am writting following code.

if(Page.IsPostBack==false)
{
try
{

BindSectionDropDownlist();
BindSubSectionDropDownlist();
BindSectionLineDropDownlist();
}

catch(Exception ex)
{
Response.Write("<script language=Javascript>alert(''"+
ex.Message.ToString()+"'');</script>");
}
}
}
// Defination of BindSectionDropDownList
private void BindSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSectionRecForReports();
reportCategory_Dropdownlist.DataTextField="Section Desc";
reportCategory_Dropdownlist.DataValueField ="sectionId";
reportCategory_Dropdownlist.DataSource=dv;
reportCategory_Dropdownlist.DataBind();
reportCategory_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSubSectionDropDownlist()
{
DataView dv = new DataView();
dv = objSectionMaster.GetSubSectionRecReports();
subSection_Dropdownlist.DataTextField="SectionDesc ";
subSection_Dropdownlist.DataValueField ="sectionId";
subSection_Dropdownlist.DataSource=dv;
subSection_Dropdownlist.DataBind();
subSection_Dropdownlist.Items.Insert(0,new
ListItem("--Select--","--Select--"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}
private void BindSectionLineDropDownlist()
{

DataView dv = new DataView();
dv = objSectionMaster.GetSectionLineRecReports();
sectionLineDesc_DropDownList.DataTextField="Sectio nLineDescription";
sectionLineDesc_DropDownList.DataValueField ="SectionLineId";
sectionLineDesc_DropDownList.DataSource= dv;
sectionLineDesc_DropDownList.DataBind();

sectionLineDesc_DropDownList.Items.Insert(0,new
ListItem("--Select--","-1"));

//reportCategoty_DropDownList.SelectedIndex=-1;
}

private void search_Button_Click(object sender, System.EventArgs e)
{
selectQuery();
}

selectQuery();
{

//Code for further processing of on the basis of
sectionLineDesc_DropDownList selection
}

selection index of first two dropdownlist is not changed but
the third selected index of third dropdownlist is changed
when i am click on search button.
any help will be greatly appreciated.



这篇关于Asp.net Dropdownlist选择的索引已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆