Hi,
I was hoping someone could help me. I am using an AdRotator control with an xml file for the banners. The problem I have is that some of the banners, when clicked on, I want to display in a new window (ie.. Target=_blank) and some I want to display in the same window (ie..Target=_parent). Is there a way I can add the target setting in the XML file for each banner so when the banner loads the correct target property is used for each banner?
Thanks in Advance!
Jay
Ad Rotator Control Targets
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Jay49 pointsPosted Jul 30, 2010, 7:23 AM EDT
I figured it out so if anyone has the same issue, here's the solution.
You can add a custom element to the XML file. I added a <TargetUrl>_blank</TargetUrl> to the file for each banner. Then in the code behind file, creat an AdCreated event handler....
protected void banner_AdCreated( object sender, AdCreatedEventArgs e)
{
banner.Target = e.AdProperties["TargetUrl"].ToString();
}
And that's it!