Category Archives: AdRotator

[RESOLVED] How can I integrate a php app in a webform

I'm almost tempted to use frames here.

We have an ASP.NET 3.5 website with a PHP forum.  The website uses a master page into which we've built some functionality like a menu and an alert banner controlled by the adRotator control.  In the forum, I've mimicked the header using html, but everytime we make a change to the master page I have to also update the code in the forum.  I can't add the alert banner to the forum at all.  We're using a third party menu, but I want to build one using the navigation controls.  If i do, what do I do about the forum?

Fow a number of reasons, I'm rewriting the entire site in 4.0.  So if there's anything that can be done to better integrate the forum, now would be a good time I guess to try. 

There's very little I can do about the code in the forum.  It isn't open source.  Is there any way at all of wrapping the forum in the master page or a modified master page?  

Isn't there any way to do this? 


I'm not very sure you can integrate masterpage to a php page. But I think you can create a master page for php as well. Thus you will not need to update both web site and the php forum at the same time. You can have a look at these links:


We're using a third party menu, but I want to build one using the navigation controls

Do you mean that you want to use ASP.NET navigation controls in PHP? I'm afraid it's hard to implement. The way I can think out is to create a custom usercontrol(navigation control) in php like in ASP.NET. Also I think you can use some CSS and Javascript style() to generate a navigation bar and encapsulate in this custom class, then render to page.

CSS navigation bar:,339024632,320283056,00.htm

Create usercontrol in php:

Hope this can help you.

Thank you, but I don't have the ability to implement your suggestion.  The php application is a third party forum, and not open source.

What I was hoping to be able to do is something like a modern day frames page.  I want to be able to add an header to a php forum, and I have to implement it from the aspx side.  Is it possible?  Is there some kind of web service or something that will do this?


umm... Maybe you can consider to use XFrame or UFrame to load the header to php page.

I'm not very sure about this. But you can have a try:

Hope this can help you.

[RESOLVED] asp: AdRotator question

I'm thinking to utilize AdRotator on my MasterPage. It looks very straightforward and easy to implement, but I'm thinking to make it a bit more complicated. I need to rotate and show ads, based on the location (State) of the end-user, which probably can be pulled from IP location, which is not always accurate, but I can't think of any other way to recognize the State the end user is in. And if end-user is outside of the U.S., then AdRotator can rotate any ads regardless of the State.

Can anyone point me in the right direction or give me some links to examples?

I don't think you can achieve using ad rotator. You have to do it from code behind.



ad.image = "image path";


However, it will be hard to get the state values from the IP address as there is no server variables that detects the state. There are some open services that provided the location based on the IP address.

why dont you try geotargeting ? if i understood clearly what you want !!!

if so please follow this link

cilck here


good luck

Basically you want to customize AdRotator advertisement file.This is possible if you load the file programatically from database..please follow my article below for the steps


You can take a decision as to which data to fetch from database depending on Request.UserLanguages

Maybe adRotator is not very useful... I also need to control statistics, like how many people clicked and where they come from etc...

Is there any out of the box software to manage banner ads?

there is a very good article that can help you out.



Probably this might be useful for you -

In the above resource, AdRotator Control is get number of clicks, similarly you can extend it to support dynamic Xml Ads...


[RESOLVED] creating imafge scroller

i need to disaly similar to
in my web application
how  culd it be done

I am not sure I understand what you are asking.  Javascript works with so you should be able to use autoscroller on the page you linked

There are many ways to accomplish the same like you can google some cool jQuery Image gallery, Javascript image gallery.

Other ways are to create a table with one row and multiple column and put it under <marquee> </marquee> tag. yes, you can stop scolling my marquee tag attribute.

If you are displaying images from the database, I advice you to use adrotator control. Easy to use and powerful.

Hope this will help.


but i think vs2005 & 2008 doesnot support marquee tag

as i had tried for it


ya javascrit works with dot net but where can i get a sample code

You have to use javascript for stuff like that.  The dot net code runs on the server not the client.  The javascript runs on the client


but i think vs2005 & 2008 doesnot support marquee tag

VS 2005/2008/2010 doesn't support intellisense for marquee but it don't stop you to use it. Almost all major browser accept this. You can give a try to this


<marquee>Hello world !</marquee>

I have tested it IE 6 +, Firefox, Opera and it is working fine for all. 


i got it

initally when i tried it was not working

any idea how do i get it from database

i need to display images with captionin the marquee

currently its hardcoded


and secondaly is it possible to get the scrol in circular motion means immediately after the last image the first image shld start


any idea how do i get it from database

Currently I don't have development environment [sorry Frown] so I can't provide you the sample, but I can help you with the right tutorial 

Please note that in this tutorial inside Item template put <marquee> like this 


<asp:DataList ID="DataList1" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
   Width="100%" BorderColor="#336699" BorderStyle="Solid" BorderWidth="2px">
<marquee behavior="alternate">
      <asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductName") %>' Font-Bold="True"
         Font-Size="10pt" ForeColor="#336699" Width="100%" />
      <br />
      <asp:Image ID="Image1" runat="server"
         ImageUrl='<%# "GetImage.aspx?id=" + Eval("ProductID") %>' />
   <ItemStyle HorizontalAlign="Center" VerticalAlign="Top"  />


also put behavior="alternate" in marquee, like above to repeat it again. I hope that will resolve the issue.

Please let me know if you face any difficulty, we can test many more methods to implement this. 



thnks fr the reply

i tired the code

i do get scrolling but not as needed

the scolling starts from halfway even if the width is 100%

i mean id there r 5 images dispalyed each image scoll start from half way & scroll its not a continious scroll


attached here with a screen shot which dispaly how images scroll. here i have harcoded the image currently but just for checking i have put the differnt values beow it


try this jquery plugin -


hi thnks its perfect

but does it support database images ?? i need to display images & conents from database



any idea how do i get it from database

According to your description ,if you store the path of image files in database ,I would like to suggest to check the sample below which describes how to create an image scroller as you mentioned.

1.Code in page(.aspx):

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <table align="center" width="100%" border="0" cellspacing="1" cellpadding="0">
                    <div id="demo" style="overflow: hidden; width: 560px; height: 100px">
                        <table cellpadding="0" align="center" border="0" cellspacing="0">
                                <td id="demo1" valign="top">
                                    <table cellspacing="0" cellpadding="0" width="560px" border="0">
                                        <tr align="center">
                                                <asp:PlaceHolder ID="PhImage1" runat="server"></asp:PlaceHolder>
                                <td id="demo2" valign="top">
                    <script type="text/javascript" language="JavaScript">

                        toleft("demo", "demo1", "demo2", 30, "Ming")

                        function $(id) { return document.getElementById(id) }

                        function toleft(demo, demo1, demo2, speed, flag) {
                            demo = $(demo); demo1 = $(demo1); demo2 = $(demo2)
                            demo2.innerHTML = demo1.innerHTML
                            function Marquee() {
                                if (demo2.offsetWidth - demo.scrollLeft <= 0) {
                                    demo.scrollLeft -= demo1.offsetWidth
                                else {
                            flag = setInterval(Marquee, speed)
                            demo.onmouseover = function () { clearInterval(flag); }
                            demo.onmouseout = function () { flag = setInterval(Marquee, speed); }

        <br />
        <br />
        <br />
        <div id="demos" style="overflow: hidden; width: 128px; height: 500px;">
            <div id="demos1">
               <asp:PlaceHolder ID="PhImage2" runat="server"></asp:PlaceHolder>
            <div id="demos2">
        <script language="javascript" type="text/javascript">
            var speed = 30
            demos2.innerHTML = demos1.innerHTML
            function Marquee() {
                if (demos2.offsetTop - demos.scrollTop <= 0)
                    demos.scrollTop -= demos1.offsetHeight
                else {
            var MyMar = setInterval(Marquee, speed)
            demos.onmouseover = function () { clearInterval(MyMar) }
            demos.onmouseout = function () { MyMar = setInterval(Marquee, speed) }

If you use C# language:

2.Code in page(.cs):

protected void Page_Load(object sender, EventArgs e)
    public void AddImageToPageFormDataBase()
        DataTable dt = getDB();
        for (int i = 0; i < dt.Rows.Count; i++)
            Image row_image = new Image();
            row_image.ImageUrl = dt.Rows[i]["ImageUrl"].ToString();
            row_image.Width = Unit.Pixel(85);
            row_image.ID = "PhImage1_Image_" + i;

            Image column_image = new Image();
            column_image.ImageUrl = dt.Rows[i]["ImageUrl"].ToString();
            column_image.Width = Unit.Pixel(85);
            column_image.ID = "PhImage2_Image_" + i;

    // You can get the data from your own database.
    // I get the datatable like this in order to run the sample more conveniently.
    private DataTable getDB()
        DataTable dt = new DataTable();
        dt.Rows.Add(new object[] { "000001", "" });
        dt.Rows.Add(new object[] { "000002", "" });
        dt.Rows.Add(new object[] { "000003", "" });
        dt.Rows.Add(new object[] { "000004", "" });
        dt.Rows.Add(new object[] { "000005", "" });
        dt.Rows.Add(new object[] { "000006", "" });
        return dt;

If you use VB.NET language:

2.Code in page(.vb):

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    End Sub
    Public Sub AddImageToPageFormDataBase()
        Dim dt As DataTable = getDB()
        For i As Integer = 0 To dt.Rows.Count - 1
            Dim row_image As New Image()
            row_image.ImageUrl = dt.Rows(i)("ImageUrl").ToString()
            row_image.Width = Unit.Pixel(85)
            row_image.ID = "PhImage1_Image_" & i

            Dim column_image As New Image()
            column_image.ImageUrl = dt.Rows(i)("ImageUrl").ToString()
            column_image.Width = Unit.Pixel(85)
            column_image.ID = "PhImage2_Image_" & i

    End Sub
    ' You can get the data from your own database.
    ' I get the datatable like this in order to run the sample more conveniently.
    Private Function getDB() As DataTable
        Dim dt As New DataTable()
        dt.Rows.Add(New Object() {"000001", ""})
        dt.Rows.Add(New Object() {"000002", ""})
        dt.Rows.Add(New Object() {"000003", ""})
        dt.Rows.Add(New Object() {"000004", ""})
        dt.Rows.Add(New Object() {"000005", ""})
        dt.Rows.Add(New Object() {"000006", ""})
        Return dt
    End Function

If you store the image files in database ,I would recommend that please check the links below for some samples that explain how to store and retrieve images from SQL Server using .NET.

Hope it can help you.