Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear fellows,
I am using a drowpdown list here I want that when i select Quotation from the dropdown then the radio button list rblSelfPA should be visible. But it is not making this radio button list visible.

I am unable to grasp the problems reason. Please tell me what is problem in my code.

C#
protected void ddlProgStatus_SelectedIndexChanged(object sender, EventArgs e)
       {

           if (ddlProgStatus.SelectedIndex != 0)
           {
               if(ddlProgStatus.SelectedItem.Text.Contain(Quotation))
               {
                   rblSelfPA.Visible =true;
               }
               else
               {
                   rblSelfPA.Visible = false;
               }
               grdQuestions.Visible = true;
               BindGridStatusQuestions();
           }
           else
           {
               grdQuestions.Visible = false;
               divOrderWon.Visible = false;
           }
       }
Posted
Updated 26-Jun-10 4:57am
v2

Have you debugged it? Where does the execution goes? Does the if-else thing work as expected?

Out here you have not given 'Quotation' in double quotes, i assume if your application is running then you must have defined this as a variable and set a value or used the Quotation word in double qutoes.
 
Share this answer
 
Yes if else works as expected. But the radiobuttonlist is not visible on the selectedindex changed. Here is the code which i have actualy used in double qutoes. Pleae help me out
protected void ddlProgStatus_SelectedIndexChanged(object sender EventArgs e)       
{          
 if (ddlProgStatus.SelectedIndex != 0)
 {  
if 
(ddlProgStatus.SelectedItem.Text.Contains("Quotation"))
{      
rblSelfPA.Visible =true;
  }
 else
  {
 rblSelfPA.Visible = false;               
} 
grdQuestions.Visible = true;   
 BindGridStatusQuestions(); 
 }
 else
   { 
 grdQuestions.Visible = false;
divOrderWon.Visible = false;  
  }       
}
 
Share this answer
 

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