0

My code is like this

<asp:UpdatePanel ID="upAssessments" runat="server">
                <ContentTemplate>
            <div class="form-group">
                <label class="col-sm-2 control-label">Notes</label>
                <div class="col-sm-5">
                    <asp:TextBox CssClass="form-control" runat="server" ID="txtAssessmentsNotes" Height="100" TextMode="MultiLine"></asp:TextBox>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12 mgntop mgnbtm align-center">

                    <asp:Button ID="btnAssessments" runat="server" CssClass="btn btn-primary" OnClick="btnAssessments_OnClick" Text="Update Assessments" />
                </div>

            </div>
                    </ContentTemplate>
                <Triggers> 
                    <asp:AsyncPostBackTrigger ControlID="btnAssessments" runat="server" EventName="Click"/>
                </Triggers>
                </asp:UpdatePanel>

Code Behind

 protected void btnAssessments_OnClick(object sender, EventArgs e)
    {
        try
        {

        }
        catch (Exception)
        {

            throw;
        }


    }

And When I click on btnAssessments click event is not firing. Does any one have any Idea?

None
  • 5,582
  • 21
  • 85
  • 170

1 Answers1

1

From MSDN's description of AsyncPostBackTrigger:

For controls that are inside a panel when the ChildrenAsTriggers property is false.

Default of ChildrenAsTriggers is true, so this is not your case. For controls inside the UpdatePanel you can use PostBackTrigger:

<asp:PostBackTrigger ControlID="btnAssessments" runat="server" />

For the difference between the two you can check out other SO questions, for example this one.

Community
  • 1
  • 1
Andrei
  • 55,890
  • 9
  • 87
  • 108