Saturday, March 24, 2012

CascadingDropDown: Pulling selected values from a cookie

I am using the CascadingDropDown extender from the AjaxControlToolkit and I was wondering if there was an easy way to set the selected value and to populate child drop downs when the page loads. I am storing a users previous selections in a cookie so when they start a new form these values are already selected. I did some looking at the CascadingDropDown code but I didn't see an easy way to accomplish this. Does anyone know an easy way to do it?

Or am I going to have to cobble some JS together to make it happen?

Thanks.

Derek

Couldn't you just do something like

myCascadingDropdownListExtender.SelectedValue = Request.Cookies("MyCookie")

on Page_Load ? It works for me.

No comments:

Post a Comment