I have an ImageButton inside an UpdatePanal, OnClick event, some process is performed on same image, then image saved in the same location.
Problem is, the code behind executes successfully, but result doesn't show on web page.
ASP Code:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="True" UpdateMode="Always" runat="server">
<ContentTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" AutoPostBack="true" ImageUrl="~/Sel_Img/test.jpg" OnClick="ImageButton1_Click" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ImageButton1" />
</Triggers>
</asp:UpdatePanel>
Code Behind
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
using (Bitmap bitmap = new Bitmap((Server.MapPath(@"/Sel_Img/test.jpg")))
Bitmap bmp = Some_Process(bitmap);
bitmap.Dispose();
bmp.Save(Server.MapPath(@"/Sel_Img/test.jpg"));
ImageButton1.ImageUrl = "../Sel_Img/test.jpg";
}
When I reload the page manually, results are shown as expected, but Onclick event of the results does not appear, i.e. Changes in image don't appear.