Click here to Skip to main content
15,906,097 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When user click the poor from dropdownlist i want to show the popup screen
My code as follows


protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if(DropDownList1.SelectedItem.ToString() == "Poor")
{
SetDropdowndetails("DropDownList1",1);
}
else
{

Pnlnegativefeedback.Visible = false;
}
}

protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList2.SelectedItem.ToString() == "Poor")
{
SetDropdowndetails("DropDownList2", 2);
}
else
{
Pnlnegativefeedback.Visible = false;
}
}


private void SetDropdowndetails(string Dropdownname, Int32 Dropdownid)
{
SelectedDropdown = Dropdownname.ToString();
hfnegativefeedback.Value = Dropdownid.ToString();
Negativepnlpopup();
}

private void Negativepnlpopup()
{

TxtNegativeFeedback.Text = "";
DataTable dt = new DataTable();
dt = (DataTable)ViewState["Remarks"];
if (ViewState["Remarks"] != null)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if (hfnegativefeedback.Value == dt.Rows[i][0].ToString())
{
TxtNegativeFeedback.Text = dt.Rows[i][1].ToString();
}
}
}

ModalPopupExtender1.TargetControlID = SelectedDropdown.ToString();
TxtNegativeFeedback.Focus();
ModalPopupExtender1.Show();
Pnlnegativefeedback.Visible = true;
}

when i click dropdownlist1 and select the poor from the dropdownlist1 the pop screen will de displayed.

But when i click dropdownlist2 and select the poor from the dropdownlsit2 the pop screen will not be displayed.

what code i written in dropdownlist1 the same code only written in dropdownlist2.

what is the problem in my above code.

regards,
Narasiman P.
Posted
Comments
agent_kruger 14-Feb-14 7:34am    
which pop up screen windows pop up or something else? please provide an image for the following.
BillWoodruff 14-Feb-14 11:12am    
If you want people to help you, why not take the time to use CP's editor to make your code look like code ?

Set a break-point at the start of your SetDropdowndetails method, and single-step through the code after you select 'Poor in the second DropDownList, examine the variables, and watch what happens, and try to understand it.

Ask specific questions here based on your observations.
ahmedfaruk88 16-Feb-14 17:43pm    
Put a break point directly after the second DropDownList2_SelectedIndexChanged statement before the the if statement and run your application, step through it and see if control flow passes through it...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900