Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
C#
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedValue == "Installment")
        {
            RadioButtonList1.Visible = true;
            Label11.Visible = true;
            txtInsAmount.Visible = true;
        }
    }


whats wrong in this code? It is not firing. The dropdownlist is inside a modalpopupextender. It is supposed to show this 3 items
C#
RadioButtonList1.Visible = true;
           Label11.Visible = true;
           txtInsAmount.Visible = true;


I cant set the auto postback to true because it will make the modalpopupextender disapper.
Posted
Updated 17-Feb-14 6:21am
v2
Comments
Ziee-M 17-Feb-14 12:31pm    
If there is no postback then the event won't fire! because its a server control.
You can make a dropdown using html or jquery, and get your values using javascript or jquery.
BeastMode10 17-Feb-14 12:34pm    
Well you are correct. I know that but I dont where to put the postback
i tried this in the page load
if (!page.ispostback)
{
....
}
Ziee-M 17-Feb-14 12:38pm    
You should put your code in the load in the PostBack: like this
if (page.ispostback)
{
....
}
or you can get rid of the if, it should work

1 solution

Set auto post back property to true. & in selected index changed event again show same model pop up using 'show' method
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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