How to use AdRotator in ASP.NET C# Without Refreshing Page Using AJAX
On my last post i explain how to use adrotator in asp.net.In this this post i am going to explain How to use AdRotator in ASP.NET C# Without Refreshing Page Using AJAX.For this we have to use Some of AJAX controls:- UpdatePanel and Timer.
Design View:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="900px" align="center">
<tr><td><h2>Example Of AD Rotator Without Refreshing Page</h2></td></tr>
<tr>
<td>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:Timer ID="Timer1" Interval="5000" runat="server">
</asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" Target="_blank" runat="server" BorderColor="#33CC33" BorderStyle="Dotted" BorderWidth="1px" AdvertisementFile="XMLFile.xml" Height="500px" Width="900px" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
