Skip to content

Ad Rotator Control Targets

Jay

Asked Jul 30, 2010, 6:13 AM EDT1 answer
Share
LinkedInX
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

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi Everyone,
    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!
    0