Create slide advertisement with XML that have URL navigator

How to create default pictures slide advertisement

Have you come across a web site where there are images moving on a slide? that might probably be ruining an advertisement for the web page. This article will show how to implement such in a simple way.

I will show simple 2 steps to get this done:


Download: Calculator


Step 1: Create .Xml file name it whatever you want, e.g slider.xml
Copy and paste the below code inside your created slider.xml file:


<?xml version="1.0" encoding="utf-8" ?>

<advertisements>
<ad>
<imageurl>~/Images/slides/teach.jpg</imageurl>
<navigateurl>https://www.maxybyte.com</navigateurl>
<alternatetext color="Blue">We will teach you how to code</alternatetext>
<impressions>50</impressions>
<keyword>Tech</keyword>
</ad>
<ad>
<imageurl>~/Images/slides/goCsharper.jpg</imageurl>
<navigateurl>https://www.maxybyte.com</navigateurl>
<alternatetext>Go Csharper with maxybyte</alternatetext>
<impressions>50</impressions>
<keyword>Tech</keyword>


</ad>

<ad>
<imageurl>~/Images/slides/serve.jpg</imageurl>
<navigateurl>https://www.maxybyte.com</navigateurl>
<alternatetext>We are here to serve you better</alternatetext>
<impressions>50</impressions>
<keyword>Tech</keyword>


</ad>

</advertisements>

Step 2: Display advertisement in the Default.aspx page

Now go to the default page in your web application or create one, then copy and paste the code below right inside the Default.aspx page:

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>

     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
      <asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/slider.xml"
            ImageUrlField="ImageUrl" NavigateUrlField="NavigateUrl"
            AlternateTextField="AlternateText" Style='position:relative' Width="1200px" Height="400px" border="1" alt="Null" CssClass="img" >
      </asp:AdRotator>
        <asp:Timer ID="Timer1" runat="server" Interval="2500"></asp:Timer>
     </ContentTemplate>
    </asp:UpdatePanel>





Note: You need to create your images folder to be able to access those images in code as I have done in "step 1" using the<imageurl>image_path</imageurl>.


Happy coding! and thanks for reading!

Please follow Maxybyte on social media.

11 comments:

  1. It’s very excellent information and more real facts to provided that post.Thank you for sharing this information. Godaddy Coupons

    ReplyDelete
  2. Portable advertising companies are proficient companies that for the most part adventure into the online versatile market to showcase and promote organizations and companies; at an expense obviously. alladsmedia ad network

    ReplyDelete
  3. Amazingly written blog that has transfixed its audience.
    drive in racking

    ReplyDelete
  4. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Mobile phones in India

    ReplyDelete
  5. Incredible posting this is from you. I am really and truly thrilled to read this marvelous post. You've really impressed me today. I hope you'll continue to do so! Skype Offline Installer

    ReplyDelete
  6. I am come here first time, i find the perfect article. Thanks for sharing interesting and informative post. intellectual property protection

    ReplyDelete
  7. Hey Matias,thank you for this feedback.

    ReplyDelete

Note: only a member of this blog may post a comment.