asp.net mvc 3 - Can One Link Invoke Two Ajax Updates? -


i have mvc 3 page has 2 partial views, 1 items in bucket a, , 1 items in bucket b (simplified discussion... there's significant logic rendering each bucket, , logic different between buckets).

i have link on page lets me move item bucket a bucket b. once link clicked, have refresh partial views items in bucket a, , partial view items in bucket b.

i can refresh 1 or other using ajax, this:

@ajax.actionlink("move b", "_bucketb", "home", new { item = model.item },  new ajaxoptions() {     updatetargetid = "divforbucketb",     httpmethod = "post",      insertionmode = insertionmode.replace }) 

how can approach problem of refreshing divforbucketa when actionlink clicked?

update

the html goes divforbucketa needs generated using appropriate view , controller. changes div contents significant processed on client in javascript (other perhaps invoking ajax call... can done?)

this how jquery. need fix url.action calls , assume bucketa controller method returns partialview.

$(document).ready(function() {    $('#mybutton").click(function() {      $.get(@url.action("index", "bucketa"), function (data) {         $('#bucketa').html(data);      });      $.get(@url.action("index", "bucketb"), function (data) {         $('#bucketb').html(data);      });       e.preventdefault();    }); }); 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -