-2
function showDataRow(rowContainerId) {

    var childControlsArray = document.getElementById(rowContainerId).childNodes;

    var StoreId, StoreName, Enabled;

    for (var i = 0; i < childControlsArray.length; i++) {

        if (childControlsArray.item(i).id == 'dvStoreId') {
            StoreId = childControlsArray[i].innerHTML;
        }
        else if (childControlsArray.item(i).id == 'dvStoreName') {
            var subchildarray = childControlsArray.item(i).childNodes;

            for (var n = 0; n < subchildarray.length; n++) {
                var hrefid = rowContainerId.replace("dvRowData", "") + "basic";

                if (subchildarray.item(n).id == hrefid) {

                    //StoreName = childControlsArray.item(i).innerHTML;
                    StoreName = subchildarray.item(i).innerHTML;

                }

            }
        }
        else if (childControlsArray.item(i).id == 'dvEnabled') {
            Enabled= childControlsArray.item(i).innerHTML;
        }

    }




    document.getElementById('EditStoreIdTxt').value = StoreId;
    document.getElementById('EditNameTxt').value = StoreName;
    // document.getElementById('EditChk').value = Enabled;

    


    $('.max').css({ 'width': 1500, 'height': 1437 });
    $('.max').fadeIn(100);
    $('.max').fadeTo("fast", 0.8);
    $('.wind').css('top', 200);
    $('.wind').css('left', 375);
    $('.wind').css('display', 'inline');
    $('.wind').fadeIn('slow');


    return false;
}

//html Repeater

<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                                        <ItemTemplate>
                                            <div id="dvRowData" runat="server" class="itemRows">                                               
                                                <div id="dvStoreId" class="w30" style="display: none">
                                                    <%# Eval("StoreId")%>
                                                </div>
                                                <div id="dvStoreName" class="w200s">
                                                <a href="#" id="basic1" runat="server">
                                                    <%# Eval("StoreName")%></a></div>
                                                <div id="dvEnabled" class="w200s" style="display: none">
                                                    <%# Eval("Enabled")%></div>
                                             
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>

Edited by peter_budo: Keep It Clear - Do use code tags when posting any code

Votes + Comments
BS
3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Philippe.Lahaie
0

i would say that is because :

<div id="dvStoreName" class="w200s">
    <a href="#" id="basic1" runat="server">
        <%# Eval("StoreName")%>
    </a>
</div>

when you find dvStoreName you start looping through all its child nodes (even though there is only the <a> tag in dvStoreName) and you look for

if (subchildarray.item(n).id == hrefid)

knowing that "var hrefid = rowContainerId.replace("dvRowData", "") + "basic";"

IF the rowContainerId you called this method with was "dvRowData34" then
hrefid = "34basic"...

but all the <a> tags in all the items the repeater wrote, all have an id equal to "basic1".

So your problems are
1) all the <a> tags have id="basic1"
2) you are comparing "basic1" with "(someID)basic"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.