locked
control with ID 'btnUpload_Click2' could not be found for the trigger in UpdatePanel 'UpdatePanel3'. RRS feed

  • Question

  • User336760158 posted

    Getting this error message

    System.InvalidOperationException: A control with ID 'btnUpload_Click2' could not be found for the trigger in UpdatePanel 'UpdatePanel3'.

    [InvalidOperationException: A control with ID 'btnUpload_Click2' could not be found for the trigger in UpdatePanel 'UpdatePanel3'.]
       System.Web.UI.UpdatePanelControlTrigger.FindTargetControl(Boolean searchNamingContainers) +441246

    Any ideas would be appreciated

    Here is the Code

    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
    <ContentTemplate>
    <<asp:LinkButton ID="LinkButton4" runat="server" CssClass="btn btn-success" OnClick="btnUpload_Click2" Width="161px">
    <span class="glyphicon glyphicon-upload"></span> Upload and Resize
    </asp:LinkButton>
    </ContentTemplate>
    <Triggers>
    <asp:PostBackTrigger Controlid="btnUpload_Click2"></asp:PostBackTrigger>
    </Triggers>
    </asp:UpdatePanel>

    Wednesday, July 24, 2019 12:23 AM

All replies

  • User-943250815 posted

    You set "btnUpload_Click2" as ControlID for PostBacktrigger, but it does not exist.
    PostBackTrigger ControlID should be ID of control that you want act as trigger

    Wednesday, July 24, 2019 12:51 AM
  • User336760158 posted

    Thanks for coming back to me.

    I may be missing something here but the ID, btnUpload_Click2 is in the update panel of the Code I showed in the post.

    I cant understand why I am getting that error message as the controlID is clearly in the updatepanel3. I must be missing something

    Wednesday, July 24, 2019 2:12 AM
  • User409696431 posted

    What you are missing is that, no, the ID btnUpload_Click2 is not in the update panel code you showed us. 

    <asp:LinkButton ID="LinkButton4" runat="server" CssClass="btn btn-success" OnClick="btnUpload_Click2" Width="161px">

    The ID is "LinkButton4".  "btnUpload_Click2" is the name of a function you are calling onclick.  (The code you showed also had <<asp:LinkButton .... , that is, an extra '<' in front.  Was that a typo when you posted the code?)

    Wednesday, July 24, 2019 2:27 AM