简体   繁体   中英

update panel not working in asp.net

Am using the update panel in my website and try to create the AsyncPostBackTrigger for a listbox. But it show the below error.So i try to create this event in page_Init section. It didn't through any error message.But i try to click the last item in list box means it postback the control and go to the first item.Please help me to fix this..

A control with ID 'ddl_discount' could not be found for the trigger in UpdatePanel 'update_pan'.

 protected void Page_Init()
        {
            AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
            trigger.EventName = "SelectedIndexChanged";
            trigger.ControlID = ddl_discount.UniqueID.ToString();
            update_pan.Triggers.Add(trigger);
        }

Try to put script manager in page instead of master page.

No need for any trigger. It works for me.

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