Re: Asp.net Dropdownlist selected index in changed
- From: "Tim_Mac" <tim.mackey@xxxxxxxxxxxxxxxx>
- Date: Wed, 6 Sep 2006 10:05:12 +0100
hi,
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" <Santoshmshinde_it@xxxxxxxxx> wrote in message
news:1157365428.171679.43920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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="SectionDesc";
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="SectionLineDescription";
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.
.
- Follow-Ups:
- Re: Asp.net Dropdownlist selected index in changed
- From: Santosh
- Re: Asp.net Dropdownlist selected index in changed
- References:
- Asp.net Dropdownlist selected index in changed
- From: Santosh
- Asp.net Dropdownlist selected index in changed
- Prev by Date: Re: regular expressions
- Next by Date: Re: JavaScript or not JavaScript
- Previous by thread: Asp.net Dropdownlist selected index in changed
- Next by thread: Re: Asp.net Dropdownlist selected index in changed
- Index(es):
Loading