I currently have an advert control which displays adverts fetched from a marketing service. The advert control uses an ID which references an ad on the marketing service's server which is then displayed on the website. So far no problem... but in order to boost performance we are now streamlining the process (since you can have multiple ads per page) whereby an Advert Manager control will request all the adverts in one request (instead of each advert control requesting independently) and then having the placed advert controls use the already requested data to render their ads.
Now the problem is that I need to communicated the ID from the advert controls to the advert manager and here I am having a bit of trouble.
I am trying to pass the advert ID from:
//Advert ID code
] = AdvertID;
to the Advert Manager control's prerender state (since I need to render the Advert Manager AFTER the controls have been render):
AdvertManager.Text = (
The problem is that the Advert Manager ends up rendering empty. Since it seems the PreRender triggers after the InitializeControls.
As soon as I test a value from: protected override void OnInit(EventArgs e) it passes correctly since that definitely renders earlier in the page life cycle.
I would really appreciate any pointers with this, since somewhere along the life cycle I'm rendering one part to early or the other part to late.