I have a page with cascad downloaded areas (select something in first area -> downloaded specific data to second area).
And I need to hide some content depending on data from the first area.
I need something like this (in javascrip开发者_StackOverflowt):
var result = getDataFromController(controllerName:"Quotes",
actionName:"IsQuoteOrdered",
param: quoteId);
Consider using jquery to simplify the ajax calls.
If you go that route the following would allow you to replace the dd2 element portion of the page with the result of a controller action call upon change of selection in dd1 :
$(document).ready(function() {
$('#dd1').change(function() {
$.ajax({
type: "POST",
cache: false,
data: 'firstDropdownSelectedValue=' + $('#dd1').val(),
url: 'YourControllerName/YourActionName',
success: function (data) {
$('#dynamicDivPortionOfThePageReturnedByYourView').replaceWith(data);
}
});
});
});
精彩评论