On ad create event for asp:adrotator (VB.net)
<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub AdCreated_Event(ByVal Sender as Object, _
ByVal E as AdCreatedEventArgs)
lblMessage.Text = "Here is information on the ad " _
& "currently being displayed:<BR>" _
& "<BR>Alternate Text: " & E.AlternateText _
& "<BR>Image URL: " & E.ImageURL _
& "<BR>Navigate URL: " & E.NavigateURL
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Writing Code that Fires when an Ad is created using an AdRotator Control</TITLE>
</HEAD>
<BODY LEFTMARGIN="40">
<form runat="server">
<asp:adrotator
id="ad1"
onadcreated="AdCreated_Event"
advertisementfile="AdRotatorCustom.xml"
target="_blank"
bordercolor="blue"
borderwidth=3
runat="server"
/>
<BR><BR>
<asp:Label
id="lblMessage"
runat="server"
/>
</form>
</BODY>
</HTML>
<%--
<Advertisements>
<Ad>
<ImageUrl>http://www.java2s.com/style/logo.png</ImageUrl>
<NavigateUrl>http://www.java2s.com</NavigateUrl>
<AlternateText>Cick me now!</AlternateText>
<Impressions>71</Impressions>
<AccountName>BLR</AccountName>
</Ad>
<Ad>
<ImageUrl>http://www.java2s.com/style/download.png</ImageUrl>
<NavigateUrl>http://www.microsoft.com</NavigateUrl>
<AlternateText>Go to Microsoft Site</AlternateText>
<Impressions>70</Impressions>
<AccountName>TVB</AccountName>
</Ad>
</Advertisements>
--%>
Related examples in the same category