Last post Mar 16, 2015 05:14 AM by Fei Han - MSFT
Mar 14, 2015 06:46 PM|vibez|LINK
I have a set of filters that make use of CascadingDropDown. When a user has selected values in the CascadingDropDown and then clicks a button which posts the page back, all the dropdowns reset themselves back and forget the values the user selected before
the postback. Is this normal?
Mar 15, 2015 08:18 AM|Rion Williams|LINK
What does your Page_Load event look like?
Generally if this is occurring, it's because you might be binding your values within the Page_Load event, but you won't want to do that every time the page is loaded (just the initial load). You can handle that by checking if a PostBack occurred using the
IsPostBack property :
protected void Page_Load(object sender, EventArgs e)
// Check if it is the initial load
// It is the initial load, initially bind your DropDown items
YourDropDownList.DataSource = GetYourValuesHere();
// Handle any specific logic here, although I doubt you want to rebind your values (as that might reset them)
Mar 16, 2015 05:14 AM|Fei Han - MSFT|LINK
Thanks for your post.
Firstly, as Rion said, you could bind your DropDownList only when the page is rendered for the first time.
Secondly, you could try to implement CascadingDropDown using Ajax Control Toolkit CascadingDropdown.