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? 

Hi,

I'm not very sure you can integrate asp.net 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 asp.net web site and the php forum at the same time. You can have a look at these links:

http://spinningtheweb.blogspot.com/2006/07/approximating-master-pages-in-php.html

http://stackoverflow.com/questions/1933168/php-equivalent-of-master-page-in-asp-net

Mainship

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:

http://www.finalwebsites.com/tutorials/css-navigation-bar.php

http://www.builderau.com.au/program/web/soa/Creating-a-pure-CSS-horizontal-navigation-bar/0,339024632,320283056,00.htm

Create usercontrol in php:

http://stackoverflow.com/questions/960097/alternative-of-asp-nets-usercontrols-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 asp.net 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?

Hi,

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

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

http://www.w3.org/TR/xframes/

http://www.codeproject.com/KB/aspnet/uframe.aspx

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.

if(state="Ohuo")

{

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



http://www.dotnetspider.com/resources/17193-Dynamic-XML-file-for-AdRotator-through-database.aspx

 

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.



http://www.4guysfromrolla.com/articles/033104-1.aspx

 

or



http://www.asp.net/community/control-gallery/browse.aspx?category=53

Probably this might be useful for you - 

http://blog.sotirovic.com/index.php/asp-net-web-controls/adrotator-for-flash-banners/

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

Thanks.

[RESOLVED] creating imafge scroller

i need to disaly similar to
 http://www.sothink.com/product/javascriptwebscroller/samples/autoscrollingimages/autoscrollingimages.htm
in my asp.net web application
how  culd it be done

I am not sure I understand what you are asking.  Javascript works with asp.net 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

svibuk

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. 

ok

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

svibuk

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

http://www.ezzylearning.com/tutorial.aspx?tid=1399196 

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">
   
   <ItemTemplate>
<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") %>' />
</marquee>
   </ItemTemplate>
   <ItemStyle HorizontalAlign="Center" VerticalAlign="Top"  />
</asp:DataList>

 

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. 

 

hi

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 - 

http://logicbox.net/jquery/simplyscroll/

Thanks.

hi thnks its perfect

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

Hi,

svibuk

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="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align="center" width="100%" border="0" cellspacing="1" cellpadding="0">
            <tr>
                <td>
                    <div id="demo" style="overflow: hidden; width: 560px; height: 100px">
                        <table cellpadding="0" align="center" border="0" cellspacing="0">
                            <tr>
                                <td id="demo1" valign="top">
                                    <table cellspacing="0" cellpadding="0" width="560px" border="0">
                                        <tr align="center">
                                            <td>
                                                <asp:PlaceHolder ID="PhImage1" runat="server"></asp:PlaceHolder>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td id="demo2" valign="top">
                                </td>
                            </tr>
                        </table>
                    </div>
                    <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 {
                                    demo.scrollLeft++
                                }
                            }
                            flag = setInterval(Marquee, speed)
                            demo.onmouseover = function () { clearInterval(flag); }
                            demo.onmouseout = function () { flag = setInterval(Marquee, speed); }
                        }

                    </script>
                </td>
            </tr>
        </table>
        <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>
            <div id="demos2">
            </div>
        </div>
        <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 {
                    demos.scrollTop++
                }
            }
            var MyMar = setInterval(Marquee, speed)
            demos.onmouseover = function () { clearInterval(MyMar) }
            demos.onmouseout = function () { MyMar = setInterval(Marquee, speed) }
        </script>
    </div>
    </form>
</body>
</html>

If you use C# language:

2.Code in page(.cs):

protected void Page_Load(object sender, EventArgs e)
    {
        AddImageToPageFormDataBase();
    }
    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;
            this.PhImage1.Controls.Add(row_image);

            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;
            this.PhImage2.Controls.Add(column_image);
        }
        

    }
    // 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.Columns.Add("id");
        dt.Columns.Add("ImageUrl");
        dt.Rows.Add(new object[] { "000001", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/Win7Logo_74x74.png" });
        dt.Rows.Add(new object[] { "000002", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/VSLight_74x74.png" });
        dt.Rows.Add(new object[] { "000003", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/sharepoint_74x74.png" });
        dt.Rows.Add(new object[] { "000004", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/AppHub_74x74.png" });
        dt.Rows.Add(new object[] { "000005", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/playvideo_74x74.png" });
        dt.Rows.Add(new object[] { "000006", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/teched_74x74.jpg" });
        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
        AddImageToPageFormDataBase()
    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
            Me.PhImage1.Controls.Add(row_image)

            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
            Me.PhImage2.Controls.Add(column_image)
        Next


    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.Columns.Add("id")
        dt.Columns.Add("ImageUrl")
        dt.Rows.Add(New Object() {"000001", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/Win7Logo_74x74.png"})
        dt.Rows.Add(New Object() {"000002", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/VSLight_74x74.png"})
        dt.Rows.Add(New Object() {"000003", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/sharepoint_74x74.png"})
        dt.Rows.Add(New Object() {"000004", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/AppHub_74x74.png"})
        dt.Rows.Add(New Object() {"000005", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/playvideo_74x74.png"})
        dt.Rows.Add(New Object() {"000006", "http://i.microsoft.com/global/en-us/homepage/PublishingImages/thumbnails/teched_74x74.jpg"})
        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.

http://www.codeproject.com/KB/cs/imaging.aspx

http://www.codeproject.com/KB/database/ImageSaveInDataBase.aspx

Hope it can help you.