Showing and Hiding the dynamic DIVs using JQuery
<p>I have got below HTML</p>

<pre><code>&lt;div style="display: block;" id="FeaturedPromo1"&gt;
    &lt;img title="Enjoy a refreshing shower" alt="Enjoy a refreshing shower" src="/english/images/spa.jpg"&gt;
    &lt;div class="slideshow-br"&gt;
        &lt;div class="slideshow-br-controls"&gt;
            &lt;a style="display: inline;" title="Prev" href="#" class="slideshow-br-controls-left"&gt;&lt;/a&gt;
                &lt;span&gt;
                    &lt;a id="active-banner-slide" style="display: inline;" title="Enjoy a refreshing shower" href="#" class="0-banner-button"&gt;&lt;/a&gt;
                    &lt;a style="display: inline;" title="The comfort of your own" href="#" class="1-banner-button"&gt;&lt;/a&gt;
                &lt;/span&gt;
            &lt;a style="display: inline;" title="Next" href="#" class="slideshow-br-controls-right"&gt;&lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;                      
&lt;/div&gt;
&lt;div style="display: none;" id="FeaturedPromo2"&gt;
    &lt;img title="The comfort of your own Private Suite" alt="The comfort of your own Private Suite" src="/english/images/suites.jpg"&gt;
    &lt;div class="slideshow-br"&gt;
        &lt;div class="slideshow-br-controls"&gt;
            &lt;a style="display: inline;" title="Prev" href="#" class="slideshow-br-controls-left"&gt;&lt;/a&gt;
                &lt;span&gt;
                    &lt;a style="display: inline;" title="Enjoy a refreshing shower" href="#" class="0-banner-button"&gt;&lt;/a&gt;
                    &lt;a id="active-banner-slide" style="display: inline;" title="The comfort of your own" href="#" class="1-banner-button"&gt;&lt;/a&gt;
                &lt;/span&gt;
            &lt;a style="display: inline;" title="Next" href="#" class="slideshow-br-controls-right"&gt;&lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;                      
&lt;/div&gt;
</code></pre>

<p>Above HTML are dynamically generated from DOT NET, so if you see right now I have got two same set of HTML with different images, it can be more according to how many FeaturedPromo controls are been added to the page, in above its only two. I have got <code>"Prev" $('.slideshow-br-controls-left')</code> and <code>"Next" $('.slideshow-br-controls-right')</code> as well as links in between the PREV and NEXT button which will show which Image is now selected. </p>

<p>Now I want to write a JQuery which will show the next DIV, I mean will hide the current and show the next div on the click of "Next" button as well as for "Prev" button.</p>

<p>Please suggest!</p>

<p>EDIT:</p>

<p>Below is the C# Code for generating the above HTML:</p>

<pre><code>    int cntShow = 0;

    foreach (FeaturedPromo promo in base.FeaturedPromos)
    {
        //Adding Input Hidden to get all the values from control
        HtmlGenericControl inputHidden = new HtmlGenericControl("input");
        inputHidden.Attributes["type"] = "hidden";
        inputHidden.Attributes["src"] = promo.ImageSource;
        inputHidden.Attributes["alt"] = promo.ImageAlt;
        inputHidden.Attributes["title"] = promo.ImageTitle;
        inputHidden.Attributes["href"] = promo.ImageHref;
        inputHidden.Attributes["height"] = promo.ImageHeight;
        inputHidden.Attributes["width"] = promo.ImageWidth;
        inputHidden.Attributes["header"] = promo.ImageHeader;
        inputHidden.Attributes["subheader"] = promo.ImageSubHeader;
        inputHidden.Attributes["color"] = promo.ImageColor;

        this.Controls.Add(inputHidden);

        //Add specific div for Featured Promo
        Panel div1 = new Panel();
        div1.Attributes["id"] = promo.ID;

        if (cntShow == 0)
        {
            div1.Style["display"] = "block";
        }
        else
        {
            div1.Style["display"] = "none";
        }

        //Adding an Image
        HtmlGenericControl image = new HtmlGenericControl("image");
        image.Attributes["src"] = promo.ImageSource;
        image.Attributes["alt"] = promo.ImageAlt;
        image.Attributes["title"] = promo.ImageTitle;
        div1.Controls.Add(image);

        //Adding two HREF for navigation
        HtmlGenericControl alinkLeft = new HtmlGenericControl("a");
        alinkLeft.Attributes["class"] = "slideshow-control-left";
        alinkLeft.Attributes["href"] = "#";
        alinkLeft.Style["display"]="inline";
        div1.Controls.Add(alinkLeft);

        HtmlGenericControl alinkRight = new HtmlGenericControl("a");
        alinkRight.Attributes["class"] = "slideshow-control-right";
        alinkRight.Attributes["href"] = "#";
        alinkRight.Style["display"] = "inline";
        div1.Controls.Add(alinkRight);

        //Adding Second div
        Panel div2 = new Panel();
        div2.CssClass = "slideshow-b";
        div1.Controls.Add(div2);

        //Adding Third div
        Panel div3 = new Panel();
        div3.CssClass = "slideshow-bl";
        div2.Controls.Add(div3);

        //Adding the A HREF Link
        HtmlGenericControl alink = new HtmlGenericControl("a");
        alink.Attributes["class"] = "slideshow-link";
        alink.Attributes["href"] = promo.ImageHref;
        div3.Controls.Add(alink);

        //Adding the first span                
        HtmlGenericControl span1 = new HtmlGenericControl("span");
        span1.Attributes["class"] = "slideshow-header";
        span1.InnerHtml = promo.ImageHeader;   
        alink.Controls.Add(span1);

        //Adding line break
        alink.Controls.Add(new LiteralControl("&lt;br/&gt;")); 

        //Adding the second span
        HtmlGenericControl span2 = new HtmlGenericControl("span");
        span2.Attributes["class"] = "slideshow-subheader";
        span2.InnerHtml = promo.ImageSubHeader;
        alink.Controls.Add(span2);
        this.Controls.Add(div1);

        if (base.FeaturedPromos.Count &gt; 1)
        {
            //Adding DIV4 for prev and next
            Panel div4 = new Panel();
            div4.CssClass = "slideshow-br";

            //Adding DIV5 inside DIV4
            Panel div5 = new Panel();
            div5.CssClass = "slideshow-br-controls";
            div4.Controls.Add(div5);

            //Adding the PREV A HREF Link
            HtmlGenericControl alinkPrev = new HtmlGenericControl("a");
            alinkPrev.Attributes["class"] = "slideshow-br-controls-left";
            alinkPrev.Attributes["href"] = "#";
            alinkPrev.Attributes["title"] = "Prev";
            alinkPrev.Style["display"] = "inline";
            alinkPrev.Attributes["CurrentDivID"] = promo.ID;                   
            div5.Controls.Add(alinkPrev);

            //Adding the span for prev and next buttons
            HtmlGenericControl span3 = new HtmlGenericControl("span");
            span3.Attributes["class"] = "slideshow-br-control-buttons";
            int count = 0;
            foreach (FeaturedPromo allPromo in base.FeaturedPromos)
            {
                //Adding the All HREF Link for Prev and Next
                HtmlGenericControl aLLlinks = new HtmlGenericControl("a");
                aLLlinks.Attributes["class"] = "" + count + "-banner-button";
                aLLlinks.Attributes["href"] = "#";
                aLLlinks.Attributes["title"] = allPromo.ImageTitle;
                aLLlinks.Style["display"] = "inline";
                if (count == cntShow)
                {
                    aLLlinks.Attributes["id"] = "active-banner-slide";
                }
                span3.Controls.Add(aLLlinks);
                count++;
            }

            div5.Controls.Add(span3);

            //Adding the NEXT A HREF Link
            HtmlGenericControl alinkNext = new HtmlGenericControl("a");
            alinkNext.Attributes["class"] = "slideshow-br-controls-right";
            alinkNext.Attributes["href"] = "#";
            alinkNext.Attributes["title"] = "Next";
            alinkNext.Style["display"] = "inline";
            alinkNext.Attributes["CurrentDivID"] = promo.ID; 
            div5.Controls.Add(alinkNext);
            div2.Controls.Add(div4);
        }
        this.Controls.Add(div1);
        cntShow++;
    } 
</code></pre>

<p>Please suggest if it is possible with code behind.</p>
