.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT
Post New Web Links

Adrotator with EntityFramwork

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

i try to bind ads from database toAdrotaor control

using EntityFramwork,but this error comes

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.


var query = from b in db.BannerSystem
                        select new
                            banner = b.Banner

AdRotator1.DataSource = query;


<asp:AdRotator ImageUrlField='<%#Eval("banner") %>' ID="AdRotator1" runat="server"


this is code

View Complete Post

More Related Resource Links

Need serious help with the adrotator control!

I'm getting fed up with this thing.  I get it to work the way I want to, then it stops working.  I get it working again, it works for awhile, then it fails again.  Repeat several times.  And yup, I thought I finallt had this thing licked, and it's failing yet again.  I'm about to ditch it and write my own.  It wouldn't be very efficient, but at least it would work!I have had a working Google ad on the master page for some time.  Now I have a paying customer, and I'm hoping for more.  My thinking is to spread out the paying ad, displaying the Google ad in between.  I have cached pages, and I don't want the ad to be cached.  Iframes and server side iframes didn't work, I'm using Ajax now.  The problem is in the AdCreated event.  This may be where my problem has been all along, but with Ajax, I can see the error when it fails if I view the page on the server.  I have the adrotator on the master page like this:                        <div id="advertising1" style="position:relative; text-align:center; top:15px;">                       &

update panel and adrotator

Hi all, I am using an update panel with a adrotator inside it and a timer control.i want my adds to get rotated(refreshed).but it does not work. this is my code: <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering=true> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode=Conditional> <Triggers>  <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers>         <ContentTemplate><asp:AdRotator ID="AdRotator1" runat="server" Height="182px" Style="z-index: 100; left: 11px; position: absolute; top: 47px" Width="166px" AdvertisementFile="~/ads.xml" OnAdCreated="AdRotator1_AdCreated" />     </ContentTemplate> </asp:UpdatePanel>    <asp:Timer ID="Timer1" runat="server" Enabled=true Interval=2000 OnTick="Timer1_Tick" > </asp:Timer>  protected void Timer1_Tick(object sender, EventArgs e) { UpdatePanel1.Update(); }   pls help thanks

update panel and adrotator

<?xml version="1.0" encoding="utf-8" ?> <Advertisements>   <Ad>     <ImageUrl>~/images/ads1.png</ImageUrl>     <AlternateText>Ad #4</AlternateText>     <Keyword>BlackPenguin</Keyword>   </Ad>   <Ad>     <ImageUrl>~/images/ads2.png</ImageUrl>     <AlternateText>DotNetCurry Home Page</AlternateText>     <Keyword>small</Keyword>   </Ad>   <Ad>     <ImageUrl>~/images/ads3.png</ImageUrl>     <AlternateText>SQL Server Curry Home Page</AlternateText>     <Keyword>small</Keyword>   </Ad>   <Ad>     <ImageUrl>~/images/ads4.png</ImageUrl>     <AlternateText>dotnetcurry.com Write For Us</AlternateText>     <Keyword>small</Keyword>   </Ad>   <Ad>     <ImageUrl>~/images/ads5.png</ImageUrl>     <AlternateText>Ad #4</AlternateText>     <Keyword>BlackPenguin</Keyword>   </Ad>   <Ad>  &nb

Custom AdRotator Source


I have an XML file that I would like to use to drive an AdRotator. The XML Structure is a little like below.


    <Gallery name="fred" TNail="xxxxxxx" descr="xxxxxxxxxxx">

        <Item category="xxxxxxx" TNail="xxxxxxxx" ImageURL="xxxxxxx" title="xxxxxxx"></Item>

        <Item category="xxxxxxx" TNail="xxxxxxxx" ImageURL="xxxxxxx" title="xxxxxxx"></Item>

        <Item category="xxxxxxx" TNail="xxxxxxxx" ImageURL="xxxxxxx" title="xxxxxxx"></Item>


    <Gallery name="john" TNail="xxxxxxx" descr="xxxxxxxxxxx">

        <Item category="xxxxxxx" TNail="xxxxxxxx" ImageURL="xxxxxxx" title="xxxxxxx"></Item>

        <Item category="xxxxxxx" TNail="xxxxxxxx" ImageURL="xxxxxxx" title="xxxxxxx"></Item>


Here we go again: Extending the AdRotator control..


Hello all,

The AdRotator control seems to be one of the least discussed and documented controls in the .NET server controls library, so I'm gonna need a bit of help extending it to suit my needs.

My AdRotator-control is databound to an SQL-server datatable and so far this works nicely, but I need to be able to count the number of impressions a given advertisment has had and update my database. 

I am able to count clicks (using a redirect page), but since I'm using a database it seems that I have absolutely no access to either getting or setting the impressions for the banners.

So, could someone please elaborate on how to extend the control to get the functionality I'm looking for?

Thanks in advance, :)


Use multiple AdRotator controls on one page - no duplicates


Is there a way to use two adrotators controls on one page and stop the same advert appearing at the same time in both controls?

I have the following but it doesn't work:

protected void AdRotator1_DataBound(object sender, EventArgs e)
        if (AdRotator1 == AdRotator)


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend