Scenario
In your page you have one repeaterA put in Zone A, another repeaterB is in Zone B and inside repeaterA transformation you call another User control / webpart(webpartB). Everytime the you trigger event on the webpartB (ie: click, change value, etc), you want to refresh the webpartA value. But you cannot access the method directly unless inside repeaterA you add the info in StockHelper and cast the information in repeaterBCode Behind repeater / Webart A - Override OnInit Event
1: protected override void OnInit(EventArgs e)
2: {
3: RequestStockHelper.Add("WebPartB", this);
4: base.OnInit(e);
5: }
Code Behind UserControl / Webpart B
Called ReloadData() from another webpart.
1: protected void LinkButton1_Click(object sender, EventArgs e)
2: {
3: CMSAbstractWebPart webpart = RequestStockHelper.GetItem("WebPartB") as CMSAbstractWebPart;
4: if (webpart != null)
5: {
6: webpart.OnContentLoaded();
7: }
8: }
0 comments:
Post a Comment