Question

I am creating an .ASP application that will drag and drop image to the stage.

this is my code:

 <asp:UpdatePanel ID="UpdatePanel3" runat="server">
          <ContentTemplate> 
               <asp:Panel ID="stage" runat="server" cssClass="containment-wrapper" style="border:1px solid #000000;" data-ajax="false">
                        <asp:Image ID="imgBrowse" runat="server" Height="376px" Width="640px" ImageUrl="Image/IC_BPO_ConnectedBPOClick-Startup_v1.1.png" CssClass="zClass" style="cursor:pointer"/>
               </asp:Panel>
          </ContentTemplate>
  </asp:UpdatePanel>
  <asp:Button ID="btnSaveImage" runat="server" Text="Button" OnClick="btnSaveImage_Click" />

Is it possible not to refresh the stage panel after clicking the btnSaveImage?

Was it helpful?

Solution

You can set the UpdateMode of the UpdatePanel to Conditional

<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
      <ContentTemplate> 
           <asp:Panel ID="stage" runat="server" cssClass="containment-wrapper" style="border:1px solid #000000;" data-ajax="false">
                    <asp:Image ID="imgBrowse" runat="server" Height="376px" Width="640px" ImageUrl="Image/IC_BPO_ConnectedBPOClick-Startup_v1.1.png" CssClass="zClass" style="cursor:pointer"/>
           </asp:Panel>
      </ContentTemplate>
  </asp:UpdatePanel>

To update the UpdatePanel, you can update it via one of the following ways:

  1. If the Update method of the UpdatePanel control is called explicitly.
  2. If a control is defined as a trigger by using the Triggers property of the UpdatePanel control and causes a postback. In this scenario, the control is an explicit trigger for updating the panel content. The trigger control can be either inside or outside the UpdatePanel control that defines the trigger.
  3. If the ChildrenAsTriggers property is set to true and a child control of the UpdatePanel control causes a postback. In this scenario, child controls of the UpdatePanel control are implicit triggers for updating the panel. Child controls of nested UpdatePanel controls do not cause the outer UpdatePanel control to be updated unless they are explicitly defined as triggers.

OTHER TIPS

You can try this...

<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
   <ContentTemplate> 
        <asp:Panel ID="stage" runat="server" cssClass="containment-wrapper"          style="border:1px solid #000000;" data-ajax="false">
                    <asp:Image ID="imgBrowse" runat="server" Height="376px" Width="640px" ImageUrl="Image/IC_B`enter code here`PO_ConnectedBPOClick-Startup_v1.1.png" CssClass="zClass" style="cursor:pointer"/>
           </asp:Panel>
      </ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSaveImage" EventName="click"/>
</Triggers>
</asp:UpdatePanel>

Please feel free to mark as answer if the answer satisfies you....

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top