Hi
I create dyunamic dropdown s and text boxex if i select drop down other district that related vilages not changed how can i solve this isssye design side i put upadat pannel in server side i create drop down and binding index changed is not wokring
Srinivasan RamamoorthiPosted Nov 8, 2021, 10:16 AM
Sachin SinghPosted Nov 8, 2021, 9:13 AM
This happens because of page life cycle
If the control is only created when an event is fired, then when your index changed event fires the control doesn't exist to bind it to on the postback.
Example:
You have to ensure the drop-down is created before .NET attemps to handle the event.
solution:- Create dynamic controls inside OnPageComplete event
protected void Page_LoadComplete(object sender, EventArgs e)
{
// yr control
this.myPlaceHolder.Controls.Add(Yrcontrol);
}
https://stackoverflow.com/questions/11126029/dynamically-added-dropdownlists-are-not-firing-selectedindexchanged-event