$(document).ready(
function() { //Attach cascading behavior to the userId select element.$(
"#userId").CascadingDropDown("#customerId", '<%= Url.Action("AsyncUsers") %>',{
promptText:
'-- Pick a User--',onLoading:
function() {$(
this).css("background-color", "#ff3");},
onLoaded:
function() {$(
this).animate({ backgroundColor: '#ffffff' }, 300);$(
this).val('<%= ViewData["UserId"] %>');}
});
//Attach cascading behavior to the roleId select element.$(
"#roleId").CascadingDropDown("#userId", '<%= Url.Action("AsyncRoles") %>',{
promptText:
'-- Pick a Role --',onLoading:
function() {$(
this).css("background-color", "#ff3");},
onLoaded:
function() {$(
this).animate({ backgroundColor: '#ffffff' }, 300);$(
this).val('<%= ViewData["RoleId"] %>');}
});
$(
"#customerId").change();$(
"#userId").change();});
</script>