Saturday, March 24, 2012

Problem by using adrotator and timer control for an atlas project

Hello.
I want to show the advertisements without page posting. I have an adrotator,an xml file,timer control,and an update panel. When I run the project only one advertisement is shown on the page then the page is blank.
My aspx.pages codes:

<div>
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
</atlas:ScriptManager>
<atlas:TimerControl ID="TimerControl1" Interval="2000" runat="server" />
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/ads.xml" />
</ContentTemplate>
</atlas:UpdatePanel>
</div
and ads.xml

<?xml version="1.0" encoding="utf-8" ?
<Advertisements>
<Ad>
<ImageUrl>Images/Book1.jpg</ImageUrl>
<NavigateUrl>http://www.Amazon.com/Book1.aspx</NavigateUrl>
<AlternateText>Book1</AlternateText>
<Impressions>2</Impressions>
<Keyword>Book</Keyword>
</Ad
<Ad>
<ImageUrl>Images/Book2.jpg</ImageUrl>
<NavigateUrl>http://www.Amazon.com/Book2.aspx</NavigateUrl>
<AlternateText>Book2</AlternateText>
<Impressions>2</Impressions>
<Keyword>Book</Keyword>
</Ad
<Ad>
<ImageUrl>Images/Book3.jpg</ImageUrl>
<NavigateUrl>http://www.Amazon.com/Book3.aspx</NavigateUrl>
<AlternateText>Book3</AlternateText>
<Impressions>3</Impressions>
<Keyword>Book</Keyword>
</Ad
<Ad>
<ImageUrl>Images/Book4.jpg</ImageUrl>
<NavigateUrl>http://www.Amazon.com/Book4.aspx</NavigateUrl>
<AlternateText>Book4</AlternateText>
<Impressions>3</Impressions>
<Keyword>Book</Keyword>
</Ad
</Advertisements
can you help me?The timer isn't in the UpdatePanel so you need to add the Tick event as a trigger.
Thanks for your reply but I tried it before too.
my aspx pages codes:

<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" >
<ErrorTemplate>
There was an error processing your action.<br />
<span id="errorMessageLabel"></span>
<hr />
<button type="button" id="okButton">OK</button>
</ErrorTemplate>
</atlas:ScriptManager>
<atlas:TimerControl ID="TimerControl1" Interval="2000" runat="server" OnTick="TimerControl1_Tick" />
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" >
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/Reklam2.xml" />
</ContentTemplate>

<Triggers>
<atlas:ControlEventTrigger ControlID="TimerControl1" EventName="Tick" />
</Triggers>
</atlas:UpdatePanel
timer tick event

protected void TimerControl1_Tick(object sender, EventArgs e)
{
UpdatePanel1.Update();
}

what is the wrong , I can not find the problem.
waiting for your reply...

Hello,

Is there anybody who can help me about this problem?


help,where is the error?
Hello,I solved the problem.

My aspx page

<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
<br />
<atlas:TimerControl ID="TimerControl1" runat="server" Interval="2000">
</atlas:TimerControl>
<br />
<div>
<atlas:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/Reklam.xml" />
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="AdRotator1" EventName="AdCreated" />
</Triggers>
</atlas:UpdatePanel>
</div>
</form
I added a trigger.
<Triggers>
<atlas:ControlEventTrigger ControlID="AdRotator1" EventName="AdCreated" />
</Triggers>
Help of this trigger,when a new advertisement is taken,updatepanel is updating. So without refreshing advertisements are shown on the web site. Reklam.xml is similar to ads.xml, only the name is Turkish.


Thanks for your example, i follow your example to solved my problem:)
not matter

No comments:

Post a Comment