hotcoder
hotcoder

Reputation: 3256

updatepanel not updating html

I've the following code:

<asp:UpdatePanel runat="server" ID="upanel1" >
        <ContentTemplate >
            <div id="west" class="x-hide-display" style="background-color: #9eb5bc; height: 100%;">

                <ul id="list_0" runat="server">
                </ul>
            </div>
        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger  ControlID ="btnImages"/>
        </Triggers>
    </asp:UpdatePanel>

and the server code is:

 list_0.InnerHtml = strPhotos.ToString()

My server code is executing but the page's html is not being updated. Please tell me what's wrong

Upvotes: 0

Views: 950

Answers (2)

hotcoder
hotcoder

Reputation: 3256

I change my code to ScriptManager.RegisterStartupScript(Me.upanel1, Me.GetType(), "saf", "$get('" + list_0.ClientID + "').innerHTML=""" + strPhotos.ToString() + """", True)

and it worked.

Upvotes: 1

adrianos
adrianos

Reputation: 1561

Nothing, as far as I can see.

Anything in your css on the div that could be hiding it? i.e class="x-hide-display" looks suspcious.

Other than, that, are you running your list_0.InnerHtml = strPhotos.ToString() code in a method called by the button's click event?

Upvotes: 0

Related Questions