How can I update using Ajax when I am displaying an image in a handler?
I have a complex page. Basically, it is a ListView with images displayed through handlers. Paging is done through a datapager. This is all wrapped in an Ajax UpdatePanel so it pages seamlessly.
When the user sees a image they like and click on it, it should display in an image above the ListView. This work when I DON'T use the updatePanel, but of course, then I get flicker. Wrapping it in an update panel results in the paging working. When the user clicks an image it goes to the db as expected, but it simply never updates the image being displayed.
Here is how the image that is clicked on is defined.
<asp:ImageBut开发者_开发知识库ton ID="imgbtnImage" runat="server" ImageUrl='<%#"~\Handlers\ThumbnailDBHandler.ashx?id=" & Eval("ID")%>' CommandArgument='<%#Eval("ID")%>'/>
does yout asp:ImageButton stays "in" update panel? 1 more thing, set update panel to use child as trigger. Because the event that postback in binable control is sometime not the control itself. It use the bindable control to postback.
eg. i have button in each grid view rows. when the button clicked, the update panel doesn't read the click event. it read the event as GridViewRowCommand. Not button click.
so set update panel to use child as trigger ans set to always update should solve the problem
精彩评论