ASP.NET - Dyanically changed home page Banner - Asked By Anto Bilson on 15-Feb-12 09:09 AM

Hi Friends,,

I've 3 images in home page Banner.Now i want change  the banner image dynamically .But those images are used in javascript function .The function called by using jquery...now i've binded images to datalist control .

How can do process to solve the problem?.

Pls suggest me to solve the issue

Thanks
D Company replied to Anto Bilson on 15-Feb-12 11:57 AM
Either you can make the header image as server control and change it using c # code or use javascript slideshow script. and you can also give atry to use GIF animator software to bind many images together into one GIF image file. or if you want to do it in quick way than u can go with  macromedia flash.


Hope its clear to you!!
D
Anto Bilson replied to Anto Bilson on 25-Apr-12 09:38 AM
script

 // Home page Banner
     var mygallery2 = new fadeSlideShow({
      wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
      dimensions: [484, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
      /*imagearray: [
      ["images/slideshow1.jpg", "", "", ""],
      ["images/slideshow2.jpg", "", "", ""],
      ["images/slideshow3.jpg", "", "", ""],],*/
     <%=Session["FadeShow"] %>
      displaymode: { type: 'auto', pause: 3000, cycles: 0, wraparound: false },
      persist: false,
      fadeduration: 1000,
      descreveal: "always",
      togglerid: ""
      })

design
<div id="slide">
            <div id="fadeshow1" style="z-index: 0">
              &nbsp;
            </div>
          </div>
Code Behind

Session["FadeShow"] = "";
        string test = "";
        //string Single_quotes = @"";
        string Double_quotes = @"""";
        //Image1.ImageUrl = dt_Banner.Rows[0]["Banner_Path"].ToString();     
        if (dt_Banner.Rows.Count > 0)
        {
          Session["FadeShow"] += "imagearray: [";
          test += "imagearray: [";
          for (int i = 0; i < dt_Banner.Rows.Count; i++)
          {
            Session["FadeShow"] += "[" + Double_quotes + dt_Banner.Rows[i]["Banner_Path"].ToString().Replace("~/", "") + Double_quotes + "," + Double_quotes + Double_quotes + "," + Double_quotes + Double_quotes + "," + Double_quotes + Double_quotes + "],";

            test += "[" + Double_quotes + dt_Banner.Rows[i]["Banner_Path"].ToString().Replace("~/", "") + Double_quotes + "," + Double_quotes + Double_quotes + "," + Double_quotes + Double_quotes + "," + Double_quotes + Double_quotes + "],";
          }
          test += "],";
          Session["FadeShow"] += "],";
        }