New Project● Select Installed Template > Visual Basic >
Web > ASP .NET Empty Web Application
● Name of application: Project_AdRotator
Site1.Master● Menu: Project > Add New Item > MasterPage● Name: Site1.Master● Design view: Click on purple
ContentPlaceHolder1, press Left (←) Arrow key to move outside of Content Placeholder.
● Insert Table with 3 rows 3 cols.● In 1st Row 2nd Col: Type “Ad Rotator”,
change its format to “H1” and “Justify Centre”.
Content in XMLFile1.xml
● Add the advertisement related content (Copy and paste from the next page):
Content
<Advertisements> <Ad>
<ImageUrl>./ad/travel1.jpg</ImageUrl> <NavigateUrl>travel1.aspx</NavigateUrl><AlternateText>Travel 1</AlternateText><Impressions>20</Impressions><Keyword>travel</Keyword>
</Ad></Advertisements>
Explanation
The image to be displayed URL to access
when the image is clicked
Alt text for accessibility
How often to stream this ad
To group the ad for filtering
Site1.Master
● In Row 2 Col 2: add the following controls:○ AJAX Extensions: ScriptManager○ AJAX Extensions: Timer○ AJAX Extensions: UpdatePanel
Webform1.aspx● Menu: Project > Add New Item
> Web Form using Master Page (Select Site1.master)
● Name: WebForm1.aspx● Add a new folder “ad” and add
three images to the folder:● Save all and Run to test.● Notice that there is a flickering
effect when the page is reloaded.
AJAX reload
In layman terms: the browser will retrieve new information in the background and update part of the web page! Example: google map, facebook news update, etc.
Site1.Master● Add a trigger by timer’s tick event. That
means with the timer ticking every 3 second, it will trigger AJAX reload of the update panel only.
Top Related