简体   繁体   中英

how to call DropDownList's onselectedindexchanged event from CreateUserWizard->WizardStep

I am using CreateUserWizard and added additional WizardStep for user additional details. I am using one dropdownlist. value has been filled from DB in dropdownlist. Now, when I will change the value in dropdownlist. I want to chekc/uncheck the one checkbox based on it's value in DB for selected dropdownlist value. For that i want to call onselectedindexchanged event of dropdownlist.

How to fire onselectedindexchanged event?

Please help me to solve this problem?

Dont add onselectedindexchanged manually

All event for element are listed in event tab on right hand side

下拉列表事件

Your code should look like

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
        onselectedindexchanged="DropDownList1_SelectedIndexChanged">
    </asp:DropDownList>

In cs file

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
     {

     }

Important Note

Remove the ViewStateMode="Disabled" in the CreateUserWizard control

Try this.

drag a dropdownlist control on your aspx page and add selectedindexchanged event, test it properly, now cut the control and paste it inside WizardStep.

I hope it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM