I have an ImageButton inside an UpdatePanal, OnClick event, Some process is preformed on same image. than Image save on same location.
Problem is, The Code Behind Executes Successfully, But result doesn't show on Webpage
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 Page Manually, Results shown as expected, But Onclick Event the results does not appear , I.E Changes in Image Doesn't Appear.
Aucun commentaire:
Enregistrer un commentaire