mhammond7635 0 Newbie Poster

Hi,

I'm a newbie & I need to create multiple iframes with an array, in a for loop! Is it even possible to do that! I accomplished it with Javascript, but I'm having a heck of a time doing the same in C#. Here's what I did in Javascript:

function load_startfrm() {

        for(i = 0; i < 25; i++) {
            ifrm[i] = document.createElement("IFRAME");
            ifrm[i].scrolling = "no";
            ifrm[i].setAttribute("src", 'http://localhost:8080/Map/png5.png');
            ifrm[i].style.width = 19.5 + "%";
            ifrm[i].style.height = 19.5 + "%";
            document.body.appendChild(ifrm[i]);
        }
        doLoop()
    }

    function load_frames() {
        
         for (var i in ifrm) {
              
           ifrm[i].setAttribute("src", url_name());
           document.body.appendChild(ifrm[i])
           //document.write();
        }
       loop = setTimeout("load_frames()", 2500);
    }

In the load_frames function, I have another function (url_name()) that randomly gets my URL. I would like to do something similar, but with C#

Thanks in advance!!

Marc

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.